2021-02-20 17:45:48 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
TLS_CLIENT="/usr/local/bin/gnutls-cli -p 1965"
|
|
|
|
|
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
|
|
|
|
|
|
|
|
errorOutput=$(echo -n "gemini://$1/\r\n" | ${TLS_CLIENT} $1 2>&1 > /dev/null)
|
|
|
|
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
|
|
|
|