Skip to content

Commit

Permalink
another improvement for ffbsee setup mode robustness
Browse files Browse the repository at this point in the history
  • Loading branch information
DEvil0000 committed Jan 9, 2022
1 parent a89a003 commit acda3e1
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions ffbsee-setup-mode/files/etc/hotplug.d/button/50-gluon-setup-mode
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,32 @@ wait_config_mode() {
fi
# turn off config page
/lib/gluon/setup-mode/rc.d/S50uhttpd stop
sleep 1
# turn on status page
/etc/rc.d/S50uhttpd start
}

wait_setup_mode() {
if [ -r /tmp/.wait_config_mode ]; then
exit
fi
sleep $wait
start_config_web_ui() {
uci set 'gluon-setup-mode.@setup_mode[0].enabled=1'
uci commit gluon-setup-mode
# turn off status page
/etc/rc.d/S50uhttpd stop
sleep 1
# turn on config page
/lib/gluon/setup-mode/rc.d/S50uhttpd start
local PID=$!
echo $PID > /tmp/.wait_config_mode
wait_config_mode &
}

wait_setup_mode() {
if [ -r /tmp/.wait_config_mode ]; then
exit
fi
sleep $wait
start_config_web_ui &
}


if [ "$BUTTON" = wps ] || [ "$BUTTON" = reset ] || [ "$BUTTON" = phone ]; then
case "$ACTION" in
Expand Down

0 comments on commit acda3e1

Please sign in to comment.