summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-splash
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-02-20 04:15:54 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-02-20 04:15:54 +0000
commitdf3d84780e2c4ec4724b2262456a1d5cc39eb789 (patch)
tree1734ed952ff7dc393fd33df6f725afffb55b5d46 /applications/luci-splash
parent9473eb8b0dd6e61446637059c05bd6623170bbd0 (diff)
applications/luci-splash: prevent duplicate firewall rules after boot
Diffstat (limited to 'applications/luci-splash')
-rwxr-xr-xapplications/luci-splash/root/etc/init.d/luci_splash17
1 files changed, 11 insertions, 6 deletions
diff --git a/applications/luci-splash/root/etc/init.d/luci_splash b/applications/luci-splash/root/etc/init.d/luci_splash
index fe451d08d..ad47a2590 100755
--- a/applications/luci-splash/root/etc/init.d/luci_splash
+++ b/applications/luci-splash/root/etc/init.d/luci_splash
@@ -25,6 +25,12 @@ iface_add() {
iptables -t nat -A luci_splash_prerouting -s "$NETWORK/$PREFIX" -d "$ipaddr" -p tcp -m multiport ! --dport 22,80,443 -j luci_splash_portal
}
+iface_del() {
+ config_get zone "$1" zone
+ [ -n "$zone" ] || return 0
+ while iptables -t nat -D prerouting_${zone} -j luci_splash_prerouting 2>&-; do :; done
+}
+
blacklist_add() {
local cfg="$1"
@@ -39,6 +45,11 @@ whitelist_add() {
[ -n "$mac" ] && iptables -t nat -I luci_splash_leases -m mac --mac-source "$mac" -j RETURN
}
+boot() {
+ ### We are started by the firewall include
+ exit 0
+}
+
start() {
### Read chains from config
include /lib/network
@@ -75,12 +86,6 @@ start() {
start-stop-daemon -S -m -p /var/run/luci-splashd.pid -b -q -x /usr/bin/luci-splashd
}
-iface_del() {
- config_get zone "$1" zone
- [ -n "$zone" ] || return 0
- while iptables -t nat -D prerouting_${zone} -j luci_splash_prerouting 2>&-; do :; done
-}
-
stop() {
### Clear interface rules
config_load luci_splash