2 # This should be sourced by bash (though we welcome changes to make it POSIX sh compliant)
4 # Monkeysphere host add-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 # add hostname user ID to server key
25 failure "You must specify a hostname to add."
30 # test that the desired user ID does not already exist
31 find_host_userid > /dev/null && \
32 failure "Host userID '$userID' already exists."
34 echo "The following user ID will be added to the host key:"
36 read -p "Are you sure you would like to add this user ID? (y/N) " OK; OK=${OK:=N}
37 if [ ${OK/y/Y} != 'Y' ] ; then
38 failure "User ID not added."
41 # edit-key script command to add user ID
42 adduidCommand=$(cat <<EOF
51 # execute edit-key script
52 if echo "$adduidCommand" | gpg_host_edit ; then
57 echo "NOTE: User ID added to key, but key not published."
58 echo "Run '$PGRM publish-key' to publish the new user ID."
60 failure "Problem adding user ID."