#!/bin/sh
# This script currently doesn't recover from errors too well.

# Set this to the password to your secret key
PGPPASS=mypassword
# Set this to the location of your keyrings and config files
PGPPATH=/X11/robm/httpd/support/auth/pgp-keys
# Set this to your user name, the name on your secret key
PGPUSER=webmaster@hoohoo.ncsa.uiuc.edu
# Set this to the full path to the PGP binary on your system
PGPBIN=/usr/local/bin/pgp


# You shouldn't need to look at the rest of this mess

export PGPPASS
export PGPPATH

# Since PGP doesn't seem to have any options for using a specific public key
# file, we'll trick it.

mkdir /tmp/pgp.$$

cat > /tmp/pgp.$$/request

for i in secring.pgp config.txt language.txt randseed.bin; do
	cp $PGPPATH/$i /tmp/pgp.$$
done

$PGPBIN -kx $* /tmp/pgp.$$/pubring.pgp $PGPPATH/pubring.pgp > /dev/null 2>&1

PGPPATH=/tmp/pgp.$$
export PGPPATH

# Make sure PGP doesn't try to make temp files in /
cd /tmp

$PGPBIN -f -u $PGPUSER < /tmp/pgp.$$/request 2> /dev/null

/bin/rm -rf /tmp/pgp.$$
