X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=contrib%2Fpackage%2Fmeshwizard%2Ffiles%2Fusr%2Fbin%2Fmeshwizard%2Fhelpers%2Fsetup_splash.sh;h=722567e813d3561ffbff457eb7ffa9e6fea2cacb;hb=d55f7135de9b7cd4345305e70cc30d143f9e37e6;hp=95b765a5a0b982feec95008dbcb71dfacc0a1219;hpb=f6d549b20cce0f13ac662c88843e5ef226262658;p=project%2Fluci.git diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh index 95b765a5a..722567e81 100755 --- a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh @@ -1,16 +1,20 @@ #!/bin/sh # Setup_splash, takes 1 argument: 1=net -. /etc/functions.sh +. /lib/functions.sh . $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." exit fi +set_defaults "luci_splash_" luci_splash.general +uci_commitverbose "Setup general splash settings" luci_splash + dhcprange=$(uci -q get meshwizard.netconfig.$net\_dhcprange) if [ "$(uci -q get meshwizard.netconfig.$net\_dhcp)" == 1 ] && [ -n "$dhcprange" ]; then @@ -25,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