aaaaaaa tabs
This commit is contained in:
parent
105fee2342
commit
e17419097a
22
protonkey
22
protonkey
@ -17,26 +17,26 @@
|
||||
# along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
|
||||
if ! test -n "$1"; then
|
||||
printf "Usage: %s [ProtonMail address]\n" "$0" 1>&2
|
||||
exit 64 # syexits(3) EX_USAGE
|
||||
printf "Usage: %s [ProtonMail address]\n" "$0" 1>&2
|
||||
exit 64 # syexits(3) EX_USAGE
|
||||
fi
|
||||
|
||||
for command in \
|
||||
curl \
|
||||
gpg
|
||||
curl \
|
||||
gpg
|
||||
do
|
||||
if ! command -v "$command" > /dev/null; then
|
||||
printf "%s: Missing dependency: %s(1)\n" "$0" "$command" 1>&2
|
||||
exit 69 # sysexits(3) EX_UNAVAILABLE
|
||||
fi
|
||||
if ! command -v "$command" > /dev/null; then
|
||||
printf "%s: Missing dependency: %s(1)\n" "$0" "$command" 1>&2
|
||||
exit 69 # sysexits(3) EX_UNAVAILABLE
|
||||
fi
|
||||
done
|
||||
|
||||
URL="https://api.protonmail.ch/pks/lookup?op=get&search=$1"
|
||||
RESPONSE="$(curl -s "$URL")"
|
||||
|
||||
if ! printf "%s\n" "$RESPONSE" | gpg --import >/dev/null 2>&1; then
|
||||
printf "%s\n" "$RESPONSE" 1>&2
|
||||
exit 76 # sysexits(3) EX_PROTOCOL
|
||||
printf "%s\n" "$RESPONSE" 1>&2
|
||||
exit 76 # sysexits(3) EX_PROTOCOL
|
||||
else
|
||||
exit 0
|
||||
exit 0
|
||||
fi
|
||||
|
Reference in New Issue
Block a user