mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-03-11 19:48:45 +01:00
wifimngr: remove extra file
This commit is contained in:
parent
841751d7e2
commit
5d16f075ab
1 changed files with 0 additions and 47 deletions
|
|
@ -1,47 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
if [ -f /tmp/wps-monitor.pid ]; then
|
||||
kill -9 $(cat /tmp/wps-monitor.pid) 2>/dev/null
|
||||
rm -f /tmp/wps-monitor.pid
|
||||
fi
|
||||
|
||||
[ "$1" == "stop" ] && exit
|
||||
|
||||
WPSENABLED=0
|
||||
for vif in $(uci show wireless | grep wifi-iface | awk -F[.,=] '{print$2}'); do
|
||||
[ "$(uci -q get wireless.$vif.wps_pushbutton)" == "1" ] && WPSENABLED=1
|
||||
done
|
||||
|
||||
if [ $WPSENABLED -eq 0 ]; then
|
||||
ubus call led.wps set '{"state":"off"}'
|
||||
exit
|
||||
fi
|
||||
|
||||
ubus listen wifi.ap wifi.bsta | \
|
||||
while read wpsevent ; do
|
||||
#echo "wps-monitor got event: $event" >/dev/console
|
||||
json_load "$wpsevent"
|
||||
if json_select wifi.ap >/dev/null; then
|
||||
json_get_var event event
|
||||
if [ "$event" == "wps-pbc-active" ]; then
|
||||
ubus call led.wps set '{"state":"notice"}'
|
||||
elif [ "$event" == "wps-reg-success" ]; then
|
||||
ubus call led.wps set '{"state":"ok","timeout":30}'
|
||||
elif [ "$event" == "wps-timeout" ]; then
|
||||
ubus call led.wps set '{"state":"off"}'
|
||||
fi
|
||||
elif json_select wifi.bsta >/dev/null; then
|
||||
json_get_var event event
|
||||
if [ "$event" == "wps-pbc-active" ]; then
|
||||
ubus call led.wps set '{"state":"notice"}'
|
||||
elif [ "$event" == "wps-success" ]; then
|
||||
ubus call led.wps set '{"state":"ok","timeout":30}'
|
||||
elif [ "$event" == "wps-timeout" ]; then
|
||||
ubus call led.wps set '{"state":"off"}'
|
||||
fi
|
||||
fi
|
||||
done &
|
||||
|
||||
echo $(($!-1)) $! >/tmp/wps-monitor.pid
|
||||
Loading…
Add table
Reference in a new issue