make sure we're explicitly capturing return codes in places where they are tested...
[monkeysphere.git] / src / monkeysphere
index a65cef62273e76671bc6fe658564195551a2ad8a..b30453ca0ff46277b0d70ee23f39bdda5d59473d 100755 (executable)
@@ -27,9 +27,6 @@ DATE=$(date -u '+%FT%T')
 # unset some environment variables that could screw things up
 unset GREP_OPTIONS
 
-# default return code
-RETURN=0
-
 # set the file creation mask to be only owner rw
 umask 077
 
@@ -87,9 +84,11 @@ check_gpg_sec_key_id() {
            echo "$gpgSecOut" | cut -d: -f5
            ;;
        *)
-           echo "Multiple primary secret keys found:" | log error
-           echo "$gpgSecOut" | cut -d: -f5 | log error
-           echo "Please specify which primary key to use." | log error
+           echo "Multiple primary secret keys found:"
+           for key in $(echo "$gpgSecOut" | cut -d: -f5) ; do
+               echo "  $key"
+           done
+           echo "Please specify which primary key to use."
            failure
            ;;
     esac
@@ -203,13 +202,11 @@ case $COMMAND in
        # those hosts
        if [ "$1" ] ; then
            update_known_hosts "$@"
-           RETURN="$?"
 
        # otherwise, if no hosts are specified, process every host
        # in the user's known_hosts file
        else
            process_known_hosts
-           RETURN="$?"
        fi
        ;;
 
@@ -219,7 +216,6 @@ case $COMMAND in
 
        # process authorized_user_ids file
        process_authorized_user_ids "$AUTHORIZED_USER_IDS"
-       RETURN="$?"
        ;;
 
     'import-subkey'|'i')