2021-02-20 17:45:48 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2021-07-03 12:07:02 +02:00
|
|
|
TLS_CLIENT="/usr/local/bin/gnutls-cli --port 1965 --no-ca-verification --crlf"
|
2021-02-20 17:45:48 +01:00
|
|
|
|
2021-02-20 21:10:00 +01:00
|
|
|
if [ "$1" = "-h" ] || [ "$1" = "--help" ]
|
2021-02-20 17:45:48 +01:00
|
|
|
then
|
|
|
|
echo "usage: $0 <capsule name> (without gemini:// scheme)"
|
|
|
|
echo
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
2021-07-03 12:07:02 +02:00
|
|
|
errorOutput=$(echo "gemini://$1/" | ${TLS_CLIENT} $1 2>&1 > /dev/null)
|
2021-02-20 17:45:48 +01:00
|
|
|
errorCode=$?
|
2021-02-20 21:10:00 +01:00
|
|
|
|
2021-02-20 17:45:48 +01:00
|
|
|
if [ $errorCode -gt 0 ]
|
|
|
|
then
|
|
|
|
echo "ERROR: ${errorOutput}"
|
|
|
|
return 2
|
|
|
|
else
|
|
|
|
echo "OK: capsule responding"
|
|
|
|
return 0
|
|
|
|
fi
|
2021-02-20 21:10:00 +01:00
|
|
|
|