feat: add autologin to ice_presence script

This commit is contained in:
etwas 2025-07-23 13:18:07 +02:00
parent b7a8552f2b
commit 0d36a6920f
Signed by: etwas
SSH key fingerprint: SHA256:bHhIeAdn/2k9jmOs6+u6ox98VYmoHUN3HfnpV2w8Ws0

View file

@ -1,5 +1,12 @@
# Check if device is in the ICE WiFi
SSID=$(iwconfig wlp1s0 | grep ESSID | sed -e 's/.*ESSID:"\(.*\)"/\1/' | xargs) SSID=$(iwconfig wlp1s0 | grep ESSID | sed -e 's/.*ESSID:"\(.*\)"/\1/' | xargs)
if [[ $SSID == "WIFIonICE" ]]; then 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 exit 0
else else
exit 1 exit 1