inteno-netmodes: reboot unless reboot is not set to 0

This commit is contained in:
Sukru Senli 2018-04-05 11:01:05 +02:00
parent c0b299231d
commit 7d9442cbb2

View file

@ -161,17 +161,13 @@ switch_netmode() {
local reboot=$(uci -q get netmode.$curmode.reboot)
if [ "$reboot" == "1" ]; then
if [ "$reboot" != "0" ]; then
reboot &
exit
fi
/etc/init.d/environment reload
case "$curmode" in
routed*)
[ -f /etc/init.d/layer2 ] && /etc/init.d/layer2 reload
ubus call uci commit '{"config":"network"}'
;;
repeater*)
touch $SWITCHMODELOCK
echo "Switching to $curmode mode" > /dev/console
@ -186,6 +182,10 @@ switch_netmode() {
ubus call leds set '{"state" : "normal"}'
rm -f $SWITCHMODELOCK
;;
*)
[ -f /etc/init.d/layer2 ] && /etc/init.d/layer2 reload
ubus call uci commit '{"config":"network"}'
;;
esac
}