From 949d80365c1f29d6b88528bdfffc8f309769f47c Mon Sep 17 00:00:00 2001 From: emma Date: Fri, 10 Mar 2023 16:36:29 -0500 Subject: [PATCH] fixed stdout stuff --- protonkey | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/protonkey b/protonkey index abbfdf8..6916bd4 100755 --- a/protonkey +++ b/protonkey @@ -16,7 +16,7 @@ # 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/. -if ! test -n "$1"; then +if test -z "$1"; then printf "Usage: %s [ProtonMail address]\n" "$0" 1>&2 exit 64 # syexits(3) EX_USAGE fi @@ -34,9 +34,10 @@ done URL="https://api.protonmail.ch/pks/lookup?op=get&search=$1" RESPONSE="$(curl -s "$URL")" -if ! printf "%s\n" "$RESPONSE"; then +if [ "$RESPONSE" = 'No key found' ]; then printf "%s\n" "$RESPONSE" 1>&2 exit 76 # sysexits(3) EX_PROTOCOL else + printf "%s\n" "$RESPONSE" exit 0 fi