summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-splash/root/etc/init.d
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-08-05 12:58:20 +0000
committerSteven Barth <steven@midlink.org>2008-08-05 12:58:20 +0000
commit2755a46c4db548cbceafcfcdfa67d476b9c0a1c5 (patch)
tree99ac020b5413285b1d66cdf7f6db01a0a7e82eed /applications/luci-splash/root/etc/init.d
parenta0d4bfceb5bc4172bea118a5941d5d3d1bfc0664 (diff)
applications/luci-splash: Updated to work with new UCI firewall
Diffstat (limited to 'applications/luci-splash/root/etc/init.d')
-rwxr-xr-xapplications/luci-splash/root/etc/init.d/luci_splash29
1 files changed, 7 insertions, 22 deletions
diff --git a/applications/luci-splash/root/etc/init.d/luci_splash b/applications/luci-splash/root/etc/init.d/luci_splash
index eb006e9b0d..7541f9935b 100755
--- a/applications/luci-splash/root/etc/init.d/luci_splash
+++ b/applications/luci-splash/root/etc/init.d/luci_splash
@@ -4,23 +4,14 @@ START=70
iface_add() {
local cfg="$1"
- config_get net "$cfg" network
- [ -n "$net" ] || return 0
+ config_get zone "$cfg" zone
+ [ -n "$zone" ] || return 0
- config_get iface "$net" ifname
- [ -n "$iface" ] || return 0
- iface="${iface%%:*}"
+ config_get gw "$cfg" gateway
+ [ -n "$zone" ] || return 0
- config_get ipaddr "$net" ipaddr
- [ -n "$ipaddr" ] || return 0
-
- config_get netmask "$net" netmask
- [ -n "$netmask" ] || return 0
-
- eval "$(ipcalc.sh $ipaddr $netmask)"
-
- iptables -t nat -A luci_splash -i "$iface" -s "$NETWORK/$PREFIX" -j luci_splash_portal
- iptables -t nat -A luci_splash_portal -i "$iface" -s "$NETWORK/$PREFIX" -d "$ipaddr" -p tcp -m multiport --dports 22,80,443 -j RETURN
+ iptables -t nat -A zone_$zone_prerouting -j luci_splash_portal
+ iptables -t nat -A luci_splash_portal -d "$gw" -p tcp -m multiport --dports 22,80,443 -j RETURN
}
blacklist_add() {
@@ -63,15 +54,9 @@ start() {
### Start the splash httpd
start-stop-daemon -S -b -q -x /usr/bin/luci-splashd
-
- ### Hook in the chain
- iptables -t nat -A prerouting_rule -j luci_splash
}
-stop() {
- ### Hook out the chain
- iptables -t nat -D prerouting_rule -j luci_splash
-
+stop() {
### Clear subchains
iptables -t nat -F luci_splash_leases
iptables -t nat -F luci_splash_portal