#!/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
