From 0d36a6920f5d58c1831b328d3f32d5c7ef0819ba Mon Sep 17 00:00:00 2001 From: etwas Date: Wed, 23 Jul 2025 13:18:07 +0200 Subject: [PATCH] feat: add autologin to ice_presence script --- home/wm/waybar/src/icestats/ice_presence.sh | 7 +++++++ 1 file changed, 7 insertions(+) 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