packages/net/mwan3/files/etc/init.d/mwan3
Florian Eckert f9a787e8df net/mwan3: add init script to enable/disable mwan3 globally
Adding a init script to "/etc/init.d/" introduce the possibility to
enable/disable mwan3 globally.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-02-05 10:29:23 +01:00

32 lines
518 B
Bash
Executable file

#!/bin/sh /etc/rc.common
START=19
reload() {
local enabled
config_load mwan3
config_get_bool enabled globals 'enabled' 0
[ ${enabled} -gt 0 ] || {
echo "Warning: mwan3 is global disabled. Usage: /etc/init.d/mwan3 start"
exit 0
}
mwan3 restart
}
boot() {
. /lib/config/uci.sh
uci_toggle_state mwan3 globals enabled "1"
}
start() {
. /lib/config/uci.sh
uci_toggle_state mwan3 globals enabled "1"
mwan3 start
}
stop() {
. /lib/config/uci.sh
uci_toggle_state mwan3 globals enabled "0"
mwan3 stop
}