turn subcommands into subfunctions, that will need to be sourced and executed.
[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 publish_key() {
16
17 read -p "Really publish host key to $KEYSERVER? (y/N) " OK; OK=${OK:=N}
18 if [ ${OK/y/Y} != 'Y' ] ; then
19     failure "key not published."
20 fi
21
22 # find the key fingerprint
23 fingerprint=$(fingerprint_server_key)
24
25 # publish host key
26 gpg_authentication "--keyserver $KEYSERVER --send-keys '0x${fingerprint}!'"
27
28 }