From b833384de98573679d5fb97542fff32b2b6526ad Mon Sep 17 00:00:00 2001 From: n Date: Sat, 20 Feb 2021 21:10:00 +0100 Subject: [PATCH] better help handling for check_gemini --- monitoring/check_gemini.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/monitoring/check_gemini.sh b/monitoring/check_gemini.sh index 8b8b361..afeac2a 100755 --- a/monitoring/check_gemini.sh +++ b/monitoring/check_gemini.sh @@ -2,7 +2,7 @@ TLS_CLIENT="/usr/local/bin/gnutls-cli -p 1965" -if [ "$1" = "-h" ] +if [ "$1" = "-h" ] || [ "$1" = "--help" ] then echo "usage: $0 (without gemini:// scheme)" echo @@ -11,6 +11,7 @@ fi errorOutput=$(echo -n "gemini://$1/\r\n" | ${TLS_CLIENT} $1 2>&1 > /dev/null) errorCode=$? + if [ $errorCode -gt 0 ] then echo "ERROR: ${errorOutput}" @@ -19,3 +20,4 @@ else echo "OK: capsule responding" return 0 fi +