gluon/package/gluon-setup-mode/files/lib/preinit/90_setup_mode
2020-07-02 22:35:05 +02:00

18 lines
503 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 ] || [ "$configured" != 1 ]; then
echo '/lib/gluon/setup-mode/rc.d' > /tmp/rc_d_path
# This directory is a marker for scripts to know that we're
# in config mode, but it is also used for temporary files
mkdir -p /var/gluon/setup-mode
fi
}
boot_hook_add preinit_main setup_mode_enable