Archived
1
0

fixed stdout stuff

This commit is contained in:
Emma Tebibyte 2023-03-10 16:36:29 -05:00
parent 71b82de86b
commit 949d80365c
Signed by: emma
GPG Key ID: 6D661C738815E7DD

View File

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