0b581d99fa5aadf456b8c5169ae5598d5e23f6f3
[monkeysphere.git] / src / share / mh / set_expire
1 # -*-shell-script-*-
2 # This should be sourced by bash (though we welcome changes to make it POSIX sh compliant)
3
4 # Monkeysphere host set-expire subcommand
5 #
6 # This is a function to set the expiration date of the monkeysphere
7 # host key.
8 #
9 # The monkeysphere scripts are written by:
10 # Jameson Rollins <jrollins@finestructure.net>
11 # Jamie McClelland <jm@mayfirst.org>
12 # Daniel Kahn Gillmor <dkg@fifthhorseman.net>
13 #
14 # They are Copyright 2008-2009, and are all released under the GPL,
15 # version 3 or later.
16
17 set_expire() {
18
19 local extendTo
20
21 # get the new expiration date
22 extendTo=$(get_gpg_expiration "$1")
23
24 log info "setting host key expiration to ${extendTo}:"
25
26 log debug "executing host expire script..."
27 gpg_host_edit expire <<EOF
28 $extendTo
29 save
30 EOF
31
32 update_gpg_pub_file
33
34 cat <<EOF | log info
35 NOTE: Host key expiration date adjusted, but not yet published.
36 Run '$PGRM publish-key' to publish the new expiration date.
37 EOF
38
39 }