2014-08-06 15:20:07 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
|
|
|
|
|
|
|
START=15
|
|
|
|
|
|
|
|
|
|
|
|
boot() {
|
2014-08-16 13:15:24 +00:00
|
|
|
local enabled="$(uci -q get 'gluon-setup-mode.@setup_mode[0].enabled')"
|
|
|
|
local configured="$(uci -q get 'gluon-setup-mode.@setup_mode[0].configured')"
|
|
|
|
|
2014-08-06 15:20:07 +00:00
|
|
|
uci set 'gluon-setup-mode.@setup_mode[0].enabled=0'
|
|
|
|
uci commit gluon-setup-mode
|
2014-08-16 13:15:24 +00:00
|
|
|
|
|
|
|
if [ "$enabled" = 1 -o "$configured" != 1 ]; then
|
|
|
|
lua -e 'uci_state=require("luci.model.uci").cursor_state(); uci_state:section("gluon-setup-mode", "setup_mode", nil, { running = "1" }); uci_state:save("gluon-setup-mode")'
|
|
|
|
else
|
|
|
|
# This can happen after an upgrade from a version before the config file was called gluon-setup-mode
|
|
|
|
# We'll just reboot to return to the normal mode...
|
2015-01-22 22:53:56 +00:00
|
|
|
/etc/init.d/done boot
|
2014-08-16 13:15:24 +00:00
|
|
|
reboot
|
|
|
|
fi
|
2014-08-06 15:20:07 +00:00
|
|
|
}
|