From 5de39bc390916c3d213b3d577e764942624ec15b Mon Sep 17 00:00:00 2001 From: ThatsRedacted Date: Thu, 6 May 2021 16:09:03 +0200 Subject: [PATCH] Add files via upload --- notificator.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 notificator.sh 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 + + + -- 1.8.3.1