summaryrefslogtreecommitdiff
path: root/src/subcommands/mh/extend-key
blob: 755fe13f19e74cb86c784213c456977ae933ca01 (plain)
  1. #!/usr/bin/env bash
  2. # Monkeysphere host extend-key subcommand
  3. #
  4. # The monkeysphere scripts are written by:
  5. # Jameson Rollins <jrollins@fifthhorseman.net>
  6. # Jamie McClelland <jm@mayfirst.org>
  7. # Daniel Kahn Gillmor <dkg@fifthhorseman.net>
  8. #
  9. # They are Copyright 2008, and are all released under the GPL, version 3
  10. # or later.
  11. # extend the lifetime of a host key:
  12. local fpr=$(fingerprint_server_key)
  13. local extendTo="$1"
  14. # get the new expiration date
  15. extendTo=$(get_gpg_expiration "$extendTo")
  16. gpg_host --quiet --command-fd 0 --edit-key "$fpr" <<EOF
  17. expire
  18. $extendTo
  19. save
  20. EOF
  21. echo
  22. echo "NOTE: Host key expiration date adjusted, but not yet published."
  23. echo "Run '$PGRM publish-key' to publish the new expiration date."