diff options
Diffstat (limited to 'applications')
-rw-r--r-- | applications/luci-splash/luasrc/model/cbi/splash/splash.lua | 17 | ||||
-rwxr-xr-x | applications/luci-splash/root/etc/init.d/luci_splash | 19 |
2 files changed, 26 insertions, 10 deletions
diff --git a/applications/luci-splash/luasrc/model/cbi/splash/splash.lua b/applications/luci-splash/luasrc/model/cbi/splash/splash.lua index ed5cdc181a..49257f1ba4 100644 --- a/applications/luci-splash/luasrc/model/cbi/splash/splash.lua +++ b/applications/luci-splash/luasrc/model/cbi/splash/splash.lua @@ -11,13 +11,24 @@ s.template = "cbi/tblsection" s.addremove = true s.anonymous = true -iface = s:option(ListValue, "zone", "Firewallzone") +zone = s:option(ListValue, "zone", "Firewallzone") luci.model.uci.foreach("firewall", "zone", function (section) - iface:value(section.name) + zone:value(section.name) end) -gateway = s:option(Value, "gateway", "Gateway") +iface = s:option(ListValue, "network", "Netzwerk") +luci.model.uci.foreach("network", "interface", + function (section) + if section[".name"] ~= "loopback" then + iface:value(section[".name"]) + end + end) + +luci.model.uci.foreach("network", "alias", + function (section) + iface:value(section[".name"]) + end) s = m:section(TypedSection, "whitelist", "Automatische Freigabe") s.template = "cbi/tblsection" diff --git a/applications/luci-splash/root/etc/init.d/luci_splash b/applications/luci-splash/root/etc/init.d/luci_splash index ad1a8b1071..4761692b36 100755 --- a/applications/luci-splash/root/etc/init.d/luci_splash +++ b/applications/luci-splash/root/etc/init.d/luci_splash @@ -7,15 +7,20 @@ iface_add() { config_get zone "$cfg" zone [ -n "$zone" ] || return 0 - config_get gw "$cfg" gateway - [ -n "$gw" ] || return 0 + config_get net "$cfg" network + [ -n "$net" ] || return 0 - iptables -t nat -A zone_${zone}_prerouting -j luci_splash_portal + config_get ipaddr "$net" ipaddr + [ -n "$ipaddr" ] || return 0 - for i in $gw - do - iptables -t nat -A luci_splash_portal -d "$i" -p tcp -m multiport --dports 22,80,443 -j RETURN - done + config_get netmask "$net" netmask + [ -n "$netmask" ] || return 0 + + eval "$(ipcalc.sh $ipaddr $netmask)" + + iptables -t nat -A zone_${zone}_prerouting -s "$NETWORK/$PREFIX" -p ! tcp -j luci_splash_portal + iptables -t nat -A zone_${zone}_prerouting -s "$NETWORK/$PREFIX" -d ! "$ipaddr" -j luci_splash_portal + iptables -t nat -A zone_${zone}_prerouting -s "$NETWORK/$PREFIX" -d "$ipaddr" -p tcp -m multiport ! --dport 22,80,443 -j luci_splash_portal } blacklist_add() { |