From: ThatsRedacted Date: Thu, 6 May 2021 14:09:03 +0000 (+0200) Subject: Add files via upload X-Git-Url: https://software.frrobert.com/stationnotifier/commitdiff_plain/5de39bc390916c3d213b3d577e764942624ec15b Add files via upload --- diff --git a/notificator.sh b/notificator.sh new file mode 100644 index 0000000..2de4909 --- /dev/null +++ b/notificator.sh @@ -0,0 +1,32 @@ +#/bin/sh + +#Ident's cert and key files paths +key='' +cert='' + +#URL of your station +url='' + +#Path to curl, that works with gemini protocol +curlpath='' + +lasttime=0 + +while [ true ] +do + $curlpath -s -k --key $key --cert $cert $url > current + IFS=' ' read -ra my_array <<< $(cat ./current | grep '/notifications') + notifications=${my_array[2]} + rm ./current + if [[ $notifications -gt $lasttime ]]; then + echo -en "\007" + echo "You have new notifications!" + read -p "Press enter to continue" + lasttime=$notifications + unset $my_array + fi + sleep 60 +done + + +