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