File: pgp-check

package info (click to toggle)
dupload 2.8.4
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 148 kB
  • ctags: 40
  • sloc: perl: 817; makefile: 54; sh: 30
file content (20 lines) | stat: -rw-r--r-- 457 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
# Verify that a changes has been signed and that the signatures are good
# (using PGP)

FILE=$1
# If no pgp is found just exit
[ ! -x "`which pgpv`" ] && exit 0
# If the file is not found just exit with error
[ ! -r "$FILE" ] && exit 2

echo -n Checking signatures before upload...

if [ -z "`cat \"$FILE\" | pgpv -fq 2>&1 | grep \"^Signature by\"`" ] ; then
	echo "PGP verification of $FILE failed!"
	exit 1
fi

echo ...signatures are ok

exit 0