better help handling for check_gemini

This commit is contained in:
n 2021-02-20 21:10:00 +01:00
parent abadf17eec
commit b833384de9
Signed by: n
GPG Key ID: E96086FC951DAE30
1 changed files with 3 additions and 1 deletions

View File

@ -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 <capsule name> (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