diff options
author | Jameson Graef Rollins <jrollins@finestructure.net> | 2008-12-16 22:00:36 -0500 |
---|---|---|
committer | Jameson Graef Rollins <jrollins@finestructure.net> | 2008-12-16 22:00:36 -0500 |
commit | 691e5d2ec8efeb4d77b17b1ad852fdbec31ce136 (patch) | |
tree | df2d25b742c0756b7a947c332982a00e3c51e812 /src/monkeysphere | |
parent | cbe3a41096ce1a30e20c419df3bb565fe2e52fcb (diff) |
get rid of getopts.
add checks for root user, and better checking of presence of host key.
Diffstat (limited to 'src/monkeysphere')
-rwxr-xr-x | src/monkeysphere | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/monkeysphere b/src/monkeysphere index 523ddfe..c003706 100755 --- a/src/monkeysphere +++ b/src/monkeysphere @@ -63,15 +63,6 @@ gen_subkey(){ keyExpire= # get options - TEMP=$(PATH="/usr/local/bin:$PATH" getopt -o l:e: -l length:,expire: -n "$PGRM" -- "$@") || failure "getopt failed! Does your getopt support GNU-style long options?" - - if [ $? != 0 ] ; then - exit 1 - fi - - # Note the quotes around `$TEMP': they are essential! - eval set -- "$TEMP" - while true ; do case "$1" in -l|--length) @@ -82,10 +73,11 @@ gen_subkey(){ keyExpire="$2" shift 2 ;; - --) - shift - ;; - *) + *) + if [ "$(echo "$1" | cut -c 1)" = '-' ] ; then + failure "Unknown option '$1'. +Type '$PGRM help' for usage." + fi break ;; esac |