2 # notifitcatorossl is a fork of https://github.com/ThatsRedacted/StationNotifier
3 # This program uses openssl rather than curl to connect to a gemini site`
10 tmpfile=$(mktemp /tmp/not.XXXXXX)
11 url="gemini://station.martinrue.com/frrobert"
20 if [[ "$url" != *://* ]];then
24 domain=$(sed 's/gemini:\/\///' <<< "$url")
26 if [[ "$url" != *.*/*.* ]] && [[ $url != */ ]];then
29 domain=$(sed 's/\/.*$//' <<< "$domain")
30 timeout $connectto openssl s_client -crlf -quiet -key $key -cert $cert -connect "$domain:1965" <<<"$url" 2>/dev/null >> $tmpfile
34 IFS=' ' read -ra my_array <<< $(cat $tmpfile | grep '/notifications')
35 notifications=${my_array[2]}
37 if [[ $notifications -gt $lasttime ]]; then
39 echo "You have new notifications!"
40 read -p "Press enter to continue, or either type amfora or lagrange to go to notifications" answer
54 echo "waiting for new notifications"
55 lasttime=$notifications