emma
/
protonkey
Archived
1
0
Fork 0

messed up find & replace

This commit is contained in:
Emma Tebibyte 2023-01-03 20:18:06 -05:00
parent e17419097a
commit 08aaf1cab3
1 changed files with 11 additions and 11 deletions

View File

@ -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