fixed stdout stuff
This commit is contained in:
parent
71b82de86b
commit
949d80365c
@ -16,7 +16,7 @@
|
|||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see https://www.gnu.org/licenses/.
|
# along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
|
||||||
if ! test -n "$1"; then
|
if test -z "$1"; then
|
||||||
printf "Usage: %s [ProtonMail address]\n" "$0" 1>&2
|
printf "Usage: %s [ProtonMail address]\n" "$0" 1>&2
|
||||||
exit 64 # syexits(3) EX_USAGE
|
exit 64 # syexits(3) EX_USAGE
|
||||||
fi
|
fi
|
||||||
@ -34,9 +34,10 @@ done
|
|||||||
URL="https://api.protonmail.ch/pks/lookup?op=get&search=$1"
|
URL="https://api.protonmail.ch/pks/lookup?op=get&search=$1"
|
||||||
RESPONSE="$(curl -s "$URL")"
|
RESPONSE="$(curl -s "$URL")"
|
||||||
|
|
||||||
if ! printf "%s\n" "$RESPONSE"; then
|
if [ "$RESPONSE" = 'No key found' ]; then
|
||||||
printf "%s\n" "$RESPONSE" 1>&2
|
printf "%s\n" "$RESPONSE" 1>&2
|
||||||
exit 76 # sysexits(3) EX_PROTOCOL
|
exit 76 # sysexits(3) EX_PROTOCOL
|
||||||
else
|
else
|
||||||
|
printf "%s\n" "$RESPONSE"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user