SHAREDIR=${SHAREDIR:-"/usr/share/monkeysphere"}
export SHAREDIR
-. "${SHAREDIR}/common"
+. "${SHAREDIR}/common" || exit 1
GLOBAL_CONFIG=${GLOBAL_CONFIG:-"${ETC}/monkeysphere.conf"}
[ -r "$GLOBAL_CONFIG" ] && . "$GLOBAL_CONFIG"
# prompt if an authentication subkey already exists
if echo "$gpgOut" | egrep "^(pub|sub):" | cut -d: -f 12 | grep -q a ; then
echo "An authentication subkey already exists for key '$keyID'."
- read -p "Are you sure you would like to generate another one? [y|N]: " OK; OK=${OK:N}
+ read -p "Are you sure you would like to generate another one? (y/N) " OK; OK=${OK:N}
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "aborting."
fi
# if hosts are specified on the command line, process just
# those hosts
if [ "$1" ] ; then
- update_known_hosts "$@" || ERR=1
+ update_known_hosts "$@"
+ ERR="$?"
# otherwise, if no hosts are specified, process every host
# in the user's known_hosts file
if [ ! -s "$KNOWN_HOSTS" ] ; then
failure "known_hosts file '$KNOWN_HOSTS' is empty."
fi
- process_known_hosts || ERR=1
- fi
- log "known_hosts file updated."
+ process_known_hosts
+ ERR="$?"
+ fi
;;
'update-authorized_keys'|'update-authorized-keys'|'a')
fi
# process authorized_user_ids file
- process_authorized_user_ids "$AUTHORIZED_USER_IDS" || ERR=1
- log "authorized_keys file updated."
+ process_authorized_user_ids "$AUTHORIZED_USER_IDS"
+ ERR="$?"
;;
'gen-subkey'|'g')