# -*-shell-script-*- # This should be sourced by bash (though we welcome changes to make it POSIX sh compliant) # Monkeysphere host set-expire subcommand # # This is a function to set the expiration date of the monkeysphere # host key. # # The monkeysphere scripts are written by: # Jameson Rollins # Jamie McClelland # Daniel Kahn Gillmor # # They are Copyright 2008-2010, and are all released under the GPL, # version 3 or later. set_expire() { local extendBy local keyID 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 log info "setting key expiration to ${extendBy}." log debug "executing key expire script..." gpg_host_edit "0x${keyID}!" expire <