contrib/meshwizard: Add lan config, rework wan config
[project/luci.git] / contrib / package / meshwizard / files / usr / bin / meshwizard / helpers / setup_splash.sh
index afbe1d5dae1e73a6da9866276357051fc1261152..95b765a5a0b982feec95008dbcb71dfacc0a1219 100755 (executable)
@@ -13,7 +13,7 @@ fi
 
 dhcprange=$(uci -q get meshwizard.netconfig.$net\_dhcprange)
 
-if [ "$dhcp_range" == 1 ]; then
+if [ "$(uci -q get meshwizard.netconfig.$net\_dhcp)" == 1 ] && [ -n "$dhcprange" ]; then
        handle_splash() {
                config_get network "$1" network
                if [ "$network" == "${netrenamed}dhcp" ]; then
@@ -25,9 +25,11 @@ if [ "$dhcp_range" == 1 ]; then
        config_load luci_splash
        config_foreach handle_splash iface
 
-       uci set luci_splash.${netrenamed}dhcp="iface"
-       uci set luci_splash.${netrenamed}dhcp.network="${netrenamed}dhcp"
-       uci set luci_splash.${netrenamed}dhcp.zone="freifunk"
+       uci batch <<- EOF
+               set luci_splash.${netrenamed}dhcp="iface"
+               set luci_splash.${netrenamed}dhcp.network="${netrenamed}dhcp"
+               set luci_splash.${netrenamed}dhcp.zone="freifunk"
+       EOF
 
        uci_commitverbose "Setup dhcpsplash for ${netrenamed}dhcp" luci_splash
        /etc/init.d/luci_splash enable