2 # This should be sourced by bash (though we welcome changes to make it POSIX sh compliant)
4 # Monkeysphere host revoke-hostname subcommand
6 # The monkeysphere scripts are written by:
7 # Jameson Rollins <jrollins@finestructure.net>
8 # Jamie McClelland <jm@mayfirst.org>
9 # Daniel Kahn Gillmor <dkg@fifthhorseman.net>
11 # They are Copyright 2008-2009, and are all released under the GPL,
14 # revoke hostname user ID from host key
27 failure "You must specify a hostname to revoke."
30 echo "WARNING: There is a known bug in this function."
31 echo "This function has been known to occasionally revoke the wrong user ID."
32 echo "Please see the following bug report for more information:"
33 echo "http://web.monkeysphere.info/bugs/revoke-hostname-revoking-wrong-userid/"
34 read -p "Are you sure you would like to proceed? (y/N) " OK; OK=${OK:=N}
35 if [ ${OK/y/Y} != 'Y' ] ; then
41 # make sure the user ID to revoke
42 uidIndex=$(find_host_userid) || \
43 failure "No non-revoked user ID found matching '$userID'."
45 echo "The following host key user ID will be revoked:"
47 read -p "Are you sure you would like to revoke this user ID? (y/N) " OK; OK=${OK:=N}
48 if [ ${OK/y/Y} != 'Y' ] ; then
49 failure "User ID not revoked."
52 # edit-key script command to revoke user ID
53 revuidCommand=$(cat <<EOF
58 Hostname removed by monkeysphere-host: $DATE
65 # execute edit-key script
66 if echo "$revuidCommand" | gpg_host_edit ; then
71 echo "NOTE: User ID revoked, but revocation not published."
72 echo "Run '$PGRM publish-key' to publish the revocation."
74 failure "Problem revoking user ID."