return "$returnCode"
}
- # check if user is root
- is_root() {
- [ $(id -u 2>/dev/null) = '0' ]
- }
-# function to interact with the authentication gnupg keyring
-# FIXME: this function requires basically accepts only a single
-# argument because of problems with quote expansion. this needs to be
-# fixed/improved.
-gpg_authentication() {
- GNUPGHOME="$GNUPGHOME_AUTHENTICATION"
- export GNUPGHOME
--
- # check that user is root, for functions that require root access
- check_user() {
- is_root || failure "You must be root to run this command."
- su_monkeysphere_user "gpg $@"
--}
--
# output just key fingerprint
fingerprint_server_key() {
# set the pipefail option so functions fails if can't read sec key
revoke_key "$@"
;;
- 'show-key'|'show'|'s')
- show_server_key
- ;;
-
'publish-key'|'publish'|'p')
- check_user
check_host_keyring
publish_server_key
;;