#!/bin/sh TMP=/tmp/pine_humbugf.$LOGNAME.$$.tmp umask 077 cat - >$TMP COMMAND=encrypt LOOP=no for TO in "$@"; do if pgp -kv 2>/dev/null | grep "$TO" >/dev/null 2>&1; then LOOP=yes true; else COMMAND=sign fi done cat $TMP | ( if [ $COMMAND = encrypt ] && [ $LOOP = yes ]; then pgpencrypt "$@" "aj@humbug.org.au" else pgpsign fi ) rm $TMP
#!/bin/sh TEMP="/tmp/pgp_filter.$LOGNAME.$$.tmp" umask 077 cat > $TEMP if grep >/dev/null 2>&1 "^-----BEGIN PGP MESSAGE-----" $TEMP; then pgppipe < $TEMP > $TEMP.2 mv $TEMP.2 $TEMP fi if grep >/dev/null 2>&1 "^-----BEGIN PGP SIGNATURE-----" $TEMP; then ( echo -----BEGIN PGP SIGNATURE CHECK----- cat $TEMP | pgp -f +batchmode 2>&1 >/dev/null | tr -d "\a" echo -----END PGP SIGNATURE CHECK----- ) | cat $TEMP - | tr -d "\a" > $TEMP.2 mv $TEMP.2 $TEMP fi cat $TEMP