made better
This commit is contained in:
parent
ca1cdeea5c
commit
914d1e64a2
14
protonkey
14
protonkey
@ -28,17 +28,11 @@ fi
|
||||
|
||||
ADDR="$1"
|
||||
URL="https://api.protonmail.ch/pks/lookup?op=get&search=$ADDR"
|
||||
echo "Resolving $URL..."
|
||||
RESPONSE="$(curl "$URL")"
|
||||
RESPONSE="$(curl -s "$URL")"
|
||||
|
||||
if [ "$RESPONSE" = "No key found" ]; then
|
||||
printf "%s\n" "RESPONSE"
|
||||
if ! printf "%s\n" "$RESPONSE" | gpg --import >/dev/null 2>&1; then
|
||||
printf "%s\n" "$RESPONSE"
|
||||
exit 76 # sysexits(3) EX_PROTOCOL
|
||||
else
|
||||
TEMPKEY=$(mktemp /tmp/pubkey-dl.XXXXXX)
|
||||
printf "%s" "$RESPONSE" > "$TEMPKEY"
|
||||
fi
|
||||
|
||||
gpg --import "$TEMPKEY"
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
Reference in New Issue
Block a user