contrib/imagebuilder: Cleanups, seperate basic and network config of firewall and...
[project/luci.git] / contrib / package / meshwizard / files / usr / bin / meshwizard / helpers / setup_splash.sh
index 1d1e248..afbe1d5 100755 (executable)
@@ -11,24 +11,25 @@ if [ ! "$has_luci_splash" == TRUE ]; then
        exit
 fi
 
-handle_splash() {
-       config_get network "$1" network
-       if [ "$network" == "${netrenamed}dhcp" ]; then
-               if [ -z "${1/cfg[0-9a-fA-F]*/}" ]; then
-                       section_rename luci_splash $1 ${netrenamed}dhcp
+dhcprange=$(uci -q get meshwizard.netconfig.$net\_dhcprange)
+
+if [ "$dhcp_range" == 1 ]; then
+       handle_splash() {
+               config_get network "$1" network
+               if [ "$network" == "${netrenamed}dhcp" ]; then
+                       if [ -z "${1/cfg[0-9a-fA-F]*/}" ]; then
+                               section_rename luci_splash $1 ${netrenamed}dhcp
+                       fi
                fi
-       fi
-}
-config_load luci_splash
-config_foreach handle_splash iface
+       }
+       config_load luci_splash
+       config_foreach handle_splash iface
 
-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 set luci_splash.${netrenamed}dhcp="iface"
+       uci set luci_splash.${netrenamed}dhcp.network="${netrenamed}dhcp"
+       uci set luci_splash.${netrenamed}dhcp.zone="freifunk"
 
-uci_commitverbose "Setup dhcpsplash for ${netrenamed}dhcp" luci_splash
-
-/etc/init.d/luci_splash enable
+       uci_commitverbose "Setup dhcpsplash for ${netrenamed}dhcp" luci_splash
+       /etc/init.d/luci_splash enable
+fi