#! /bin/sh ## keyfoo -- do something with a key, and e-mail it to its owner ## (C) 2001 Gergely Nagy ## (C) 2004 Benjamin Hill (Mako) ## ## Released under the terms of the GNU GPL v2. ## ## some globals, initialized as empty KF_KEY= KF_ADDRESS= KF_RECIPIENT= KF_KEYID= TEMPFILE= KF_BODY= KF_KEYFILE= GPG='gpg' KF_MAIL_CMD='mutt -F /dev/null -H "${KF_BODY}" -a "${KF_KEYFILE}" -e "set "' # do not send email with the key # KF_NOMAIL=1 # do not upload the key to a keyserver KF_NOSEND=1 ## this one prints the usage, *wonder* keyfoo_usage () { cat < EOF exit ${1:-0} } ## this one LARTs the user keyfoo_not_configured () { cat <${KF_BODY} < Bcc: mako@bork.hampshire.edu X-Met: key signing Attached to this e-mail is your GPG key which has now been signed by both of my public keys. I have *not* uploaded your key to any keyservers. Please import the key and upload it yourself. I hope you will sign both of my public keys (607559E6 and C99870B1). Note that I am in control of both and . Please sign both UIDs on both keys upload them to keyservers. Thank you if you already have. Regards, Benjamin Mako Hill EOF # export the key.. KF_KEYFILE=${TEMPFILE}.key $GPG --armor --export ${KF_KEY} >${KF_KEYFILE} # ..then launch the mailer if [ ! "${KF_NOMAIL}" ]; then eval ${KF_MAIL_CMD} fi rm -f ${KF_KEYFILE} ${KF_BODY} #### export the key if [ ! "${KF_NOSEND}" ]; then eval "${GPG} --send-key ${KF_KEY}" fi