diff --git a/home/wm/waybar/src/icestats/ice_presence.sh b/home/wm/waybar/src/icestats/ice_presence.sh index 07425bf..3dad766 100755 --- a/home/wm/waybar/src/icestats/ice_presence.sh +++ b/home/wm/waybar/src/icestats/ice_presence.sh @@ -1,5 +1,12 @@ +# Check if device is in the ICE WiFi SSID=$(iwconfig wlp1s0 | grep ESSID | sed -e 's/.*ESSID:"\(.*\)"/\1/' | xargs) if [[ $SSID == "WIFIonICE" ]]; then + # Authenticate for WiFi if needed; QoL Sache + wifi_data=$(curl -s 'https://login.wifionice.de/cna/wifi/user_info') + if [[ $(echo "$wifi_data" | jq -r '.result.authenticated') == "0" ]]; then + curl 'https://login.wifionice.de/cna/logon' -X POST + fi + exit 0 else exit 1