merging from jrollins
[monkeysphere.git] / src / monkeysphere-host
index 31f031ed91618f9e0e3e89e41d0a978484ad83f7..1f6825662382232440d1f85edb5b5eed53febf39 100755 (executable)
@@ -97,16 +97,6 @@ gpg_host() {
     return "$returnCode"
 }
 
-# check if user is root
-is_root() {
-    [ $(id -u 2>/dev/null) = '0' ]
-}
-
-# check that user is root, for functions that require root access
-check_user() {
-    is_root || failure "You must be root to run this command."
-}
-
 # output just key fingerprint
 fingerprint_server_key() {
     # set the pipefail option so functions fails if can't read sec key
@@ -202,37 +192,31 @@ case $COMMAND in
        ;;
 
     'extend-key'|'e')
-       check_user
        check_host_keyring
        extend_key "$@"
        ;;
 
     'add-hostname'|'add-name'|'n+')
-       check_user
        check_host_keyring
        add_hostname "$@"
        ;;
 
     'revoke-hostname'|'revoke-name'|'n-')
-       check_user
        check_host_keyring
        revoke_hostname "$@"
        ;;
 
     'add-revoker'|'o')
-       check_user
        check_host_keyring
        add_revoker "$@"
        ;;
 
     'revoke-key'|'r')
-       check_user
        check_host_keyring
        revoke_key "$@"
        ;;
 
     'publish-key'|'publish'|'p')
-       check_user
        check_host_keyring
        publish_server_key
        ;;