gluon/package/gluon-setup-mode/files/lib/preinit/90_setup_mode
Matthias Schiffer f9e5e3325f gluon-setup-mode: cleanup and upgrade fix
Since switching to Barrier Breaker/procd, we'd not notice if we were
upgrading from a version before renaming the config file to gluon-setup-mode
as the upgrade scripts run after the preinit.

Fix this by checking later during setup mode init again and rebooting into the
regular run mode if we detect this case.
2014-08-16 15:15:24 +02:00

14 lines
343 B
Bash

#!/bin/sh
setup_mode_enable() {
local enabled="$(uci -q get 'gluon-setup-mode.@setup_mode[0].enabled')"
local configured="$(uci -q get 'gluon-setup-mode.@setup_mode[0].configured')"
if [ "$enabled" = 1 -o "$configured" != 1 ]; then
echo '/lib/gluon/setup-mode/rc.d' > /tmp/rc_d_path
fi
}
boot_hook_add preinit_main setup_mode_enable