2014-07-05 18:11:41 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
|
|
wait=3
|
|
|
|
|
|
|
|
|
|
|
|
wait_setup_mode() {
|
|
|
|
sleep $wait
|
|
|
|
uci set 'gluon-setup-mode.@setup_mode[0].enabled=1'
|
|
|
|
uci commit gluon-setup-mode
|
|
|
|
reboot
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-09-30 19:38:40 +00:00
|
|
|
if [ "$BUTTON" = wps ] || [ "$BUTTON" = reset ] || [ "$BUTTON" = phone ]; then
|
2014-07-05 18:11:41 +00:00
|
|
|
case "$ACTION" in
|
|
|
|
pressed)
|
|
|
|
wait_setup_mode &
|
|
|
|
PID=$!
|
|
|
|
echo $PID > /tmp/.wait_setup_mode
|
|
|
|
;;
|
|
|
|
released)
|
|
|
|
if [ -r /tmp/.wait_setup_mode ]; then
|
2019-09-30 19:38:40 +00:00
|
|
|
kill "$(cat /tmp/.wait_setup_mode)"
|
2014-07-05 18:11:41 +00:00
|
|
|
rm /tmp/.wait_setup_mode
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|