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