diff options
author | Matt Goins <mjgoins@openflows.com> | 2009-01-31 18:32:12 -0500 |
---|---|---|
committer | Matt Goins <mjgoins@openflows.com> | 2009-01-31 18:32:12 -0500 |
commit | 26bdfd9c0aa0853ca1ea80e1980e7e9849646e10 (patch) | |
tree | 1a92ec7a3cc4df963bf8d3df82115c39ea4fe031 /src/monkeysphere-host | |
parent | 53f4ee78f320371a0f07865b21fdb4d6707a79d6 (diff) | |
parent | 7d4b4815db8ba2f6f984a18a90b50032cf9158ba (diff) |
Merge commit 'dkg/master'
Conflicts:
src/monkeysphere-host
Diffstat (limited to 'src/monkeysphere-host')
-rwxr-xr-x | src/monkeysphere-host | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/monkeysphere-host b/src/monkeysphere-host index 31f031e..9439264 100755 --- a/src/monkeysphere-host +++ b/src/monkeysphere-host @@ -48,10 +48,10 @@ subcommands: publish-key (p) publish server host key to keyserver expert - import-key (i) [NAME[:PORT]] import existing ssh key to gpg + import-key (i) NAME[:PORT] import existing ssh key to gpg --keyfile (-f) FILE key file to import --expire (-e) EXPIRE date to expire - gen-key (g) [NAME[:PORT]] generate gpg key for the host + gen-key (g) NAME[:PORT] generate gpg key for the host --length (-l) BITS key length in bits (2048) --expire (-e) EXPIRE date to expire diagnostics (d) monkeysphere host status @@ -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 ;; |