2024-01-25 14:39:08 +01:00
|
|
|
#!/bin/dash
|
|
|
|
|
|
|
|
if=$1
|
|
|
|
|
|
|
|
status (){
|
|
|
|
status=$(cat /sys/class/net/wlan0/operstate)
|
|
|
|
|
|
|
|
if [ "$status" != "down" ]; then
|
2024-01-27 18:58:40 +01:00
|
|
|
ssid="$(iw dev wlan0 link | grep SSID | cut -d':' -f2)"
|
2024-01-25 14:39:08 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "{\"status\": \"$status\", \"ssid\": \"$ssid\"}"
|
|
|
|
}
|
|
|
|
|
|
|
|
status
|
|
|
|
iwevent 2> /dev/null | while read -r line; do
|
|
|
|
status
|
|
|
|
done
|