contrib/meshwizard: Also setup a dhcp server on the adhoc interface if VAP is used...
[project/luci.git] / contrib / package / meshwizard / files / usr / bin / meshwizard / helpers / setup_splash.sh
index 9741111..722567e 100755 (executable)
@@ -5,6 +5,7 @@
 . $dir/functions.sh
 
 net=$1
+vap=$(uci -q get meshwizard.netconfig.${net}_vap)
 
 if [ ! "$has_luci_splash" == TRUE ]; then
        echo "    Luci Splash is not installed, skipping setup of it."
@@ -28,13 +29,21 @@ if [ "$(uci -q get meshwizard.netconfig.$net\_dhcp)" == 1 ] && [ -n "$dhcprange"
        config_load luci_splash
        config_foreach handle_splash iface
 
+       if [ "$vap" == 1 ]; then
+               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
+       fi
        uci batch <<- EOF
-               set luci_splash.${netrenamed}dhcp="iface"
-               set luci_splash.${netrenamed}dhcp.network="${netrenamed}dhcp"
-               set luci_splash.${netrenamed}dhcp.zone="freifunk"
+               set luci_splash.${netrenamed}ahdhcp="iface"
+               set luci_splash.${netrenamed}ahdhcp.network="${netrenamed}ahdhcp"
+               set luci_splash.${netrenamed}ahdhcp.zone="freifunk"
        EOF
+       uci_commitverbose "Setup dhcpsplash for ${netrenamed}ahdhcp" luci_splash
 
-       uci_commitverbose "Setup dhcpsplash for ${netrenamed}dhcp" luci_splash
        /etc/init.d/luci_splash enable
 fi