792d858796795d1103327262368ab561e3e1e53b
[monkeysphere.git] / src / subcommands / mh / publish-key
1 #!/usr/bin/env bash
2
3 # Monkeysphere host publish-key subcommand
4 #
5 # The monkeysphere scripts are written by:
6 # Jameson Rollins <jrollins@fifthhorseman.net>
7 # Jamie McClelland <jm@mayfirst.org>
8 # Daniel Kahn Gillmor <dkg@fifthhorseman.net>
9 #
10 # They are Copyright 2008, and are all released under the GPL, version 3
11 # or later.
12
13 # publish server key to keyserver
14
15 read -p "Really publish host key to $KEYSERVER? (y/N) " OK; OK=${OK:=N}
16 if [ ${OK/y/Y} != 'Y' ] ; then
17     failure "key not published."
18 fi
19
20 # find the key fingerprint
21 fingerprint=$(fingerprint_server_key)
22
23 # publish host key
24 gpg_authentication "--keyserver $KEYSERVER --send-keys '0x${fingerprint}!'"