#! /bin/sh ## keyfoo -- do something with a key, and e-mail it to its owner ## (C) 2001 Gergely Nagy ## ## Released under the terms of the GNU GPL v2. ## ## $Id: keyfoo,v 1.6 2001/06/27 14:30:43 mhp Exp $ ## Last updated: <2001/06/27 16:30:27 algernon> ## ## some globals, initialized as empty KF_KEY= KF_ADDRESS= KF_RECIPIENT= KF_KEYID= TEMPFILE= KF_BODY= KF_KEYFILE= KF_KEYSERVER=keyring.debian.org GPG=gpg KF_MAIL_CMD='mutt -H "${KF_BODY}" -a "${KF_KEYFILE}"' ## this one prints the usage, *wonder* keyfoo_usage () { cat < [keyserver] EOF exit ${1:-0} } ## this one LARTs the user keyfoo_not_configured () { cat <${KF_BODY} < To: ${KF_RECIPIENT} Subject: ${KF_SUBJECT} Fcc: =debian/keysigning Hi, Attached to this e-mail is your signed GPG key. I've also uploaded it to the keyserver at ${KF_KEYSERVER}. Cheers, EOF # export the key.. KF_KEYFILE="${TEMPFILE}.key" $GPG --armor --export "${KF_KEY}" >"${KF_KEYFILE}" # ..then launch the mailer eval ${KF_MAIL_CMD} rm -f "${KF_KEYFILE}" "${KF_BODY}" $GPG --keyserver "${KF_KEYSERVER}" --send-key "${KF_KEY}"