update
[stationnotifier] / notificator.sh
1 #/bin/sh
2
3 #Ident's cert and key files paths
4 key=''
5 cert=''
6
7 #URL of your station
8 url=''
9
10 #Path to curl, that works with gemini protocol
11 curlpath=''
12
13 lasttime=0
14
15 while [ true ]
16 do
17     $curlpath -s -k --key $key --cert $cert $url > current
18     IFS=' ' read -ra my_array <<< $(cat ./current | grep '/notifications')
19     notifications=${my_array[2]}
20     rm ./current
21     if [[ $notifications -gt $lasttime ]]; then
22         echo -en "\007"
23         echo "You have new notifications!"
24         read -p "Press enter to continue"
25         lasttime=$notifications
26         unset $my_array
27     fi
28     sleep 60
29 done
30
31
32