X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fshare%2Fmh%2Fset_expire;h=be3f6bb4b8cdc61ff8b28b046464b64ad3db640e;hb=9307f58b4fdf8e139c4fd5de5c3a878b8b12d0b1;hp=2389e573515505f9d6bdb66e3708680836bcbc56;hpb=9cc92238a9a9b21d37b983932d5a6a012cf80aba;p=monkeysphere.git diff --git a/src/share/mh/set_expire b/src/share/mh/set_expire index 2389e57..be3f6bb 100644 --- a/src/share/mh/set_expire +++ b/src/share/mh/set_expire @@ -11,23 +11,52 @@ # Jamie McClelland # Daniel Kahn Gillmor # -# They are Copyright 2008-2009, and are all released under the GPL, +# They are Copyright 2008-2010, and are all released under the GPL, # version 3 or later. -set-expire() { +set_expire() { -local extendTo +local extendBy +local keyID -# get the new expiration date -extendTo=$(get_gpg_expiration "$1") +if [ -z "$1" ] ; then + cat <&2 +Must specify expiration. The possibilities are: + 0 = key does not expire + = key expires in n days + w = key expires in n weeks + m = key expires in n months + y = key expires in n years +EOF + failure +fi +extendBy="$1" +shift + +keyID=$(check_key_input "$@") + +if [ "$PROMPT" = "true" ] ; then + printf "Are you sure you want to change the expiration on key '$keyID' by '%s'? (Y/n) " "$extendBy" >&2 + read OK; OK=${OK:-Y} + if [ "${OK/y/Y}" != 'Y' ] ; then + failure "expiration not set." + fi +else + log debug "extending without prompting." +fi -gpg_host_edit expire <