;;
*)
if [ -z "$keyID" ] ; then
- failure "Keyring contains multiple keys. Please specify one to act on (see 'monkeysphere-host show-key')."
+ failure "Your host keyring contains multiple keys.
+Please specify one to act on (see 'monkeysphere-host show-key')."
fi
;;
esac
printf '%s\n' "${fprs[@]}" | grep "${keyID}$" \
- || failure "Key '$keyID' not found."
+ || failure "Host key '$keyID' not found."
}
# return 0 if user ID was found.
if [[ -z "$1" || "$1" == '--all' ]] ; then
keys="${fprs[@]}"
- else
- for key in $keys ; do
- printf '%s\n' "${fprs[@]}" | grep "${key}$" \
- || failure "Key '$key' not found."
- done
fi
for key in $keys ; do
# create the ssh key
TMPSSH="$GNUPGHOME"/ssh_host_key_rsa_pub
- gpg --export "$id" | openpgp2ssh 2>/dev/null >"$TMPSSH"
+ if ! gpg --export "$id" 2>/dev/null \
+ | openpgp2ssh 2>/dev/null >"$TMPSSH" ; then
+ failure "Key '$id' not found."
+ fi
# get the gpg fingerprint
fingerprint=$(gpg --quiet --list-keys \