755fe13f19e74cb86c784213c456977ae933ca01
[monkeysphere.git] / src / subcommands / mh / extend-key
1 #!/usr/bin/env bash
2
3 # Monkeysphere host extend-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 # extend the lifetime of a host key:
14
15 local fpr=$(fingerprint_server_key)
16 local extendTo="$1"
17
18 # get the new expiration date
19 extendTo=$(get_gpg_expiration "$extendTo")
20
21 gpg_host --quiet --command-fd 0 --edit-key "$fpr" <<EOF 
22 expire
23 $extendTo
24 save
25 EOF
26
27 echo
28 echo "NOTE: Host key expiration date adjusted, but not yet published."
29 echo "Run '$PGRM publish-key' to publish the new expiration date."