X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-splash%2Froot%2Fetc%2Finit.d%2Fluci_splash;h=4761692b36780ac1af4be33c029d783716a80e40;hp=02fdd8b6a58cd080e6571a8c616230f9e05de414;hb=fbae92e522692d9bb34501ad9a805da794a47123;hpb=2414448845899ad67c1f4b39885c6e2cfc4a5b47 diff --git a/applications/luci-splash/root/etc/init.d/luci_splash b/applications/luci-splash/root/etc/init.d/luci_splash index 02fdd8b6a..4761692b3 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() {