summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/luci-splash/src/luci_splash.init
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-04-26 21:29:14 +0000
committerSteven Barth <steven@midlink.org>2008-04-26 21:29:14 +0000
commitf801df7d4d44d8b85ae17fa5d191b96602c1fa9a (patch)
treeb32af471a440d417837e640450dccda016434d2c /contrib/package/luci-splash/src/luci_splash.init
parent035a193353b9ad86621b6b1fa183ccb1e0bd9e3d (diff)
* luci-splash: Fixes
Diffstat (limited to 'contrib/package/luci-splash/src/luci_splash.init')
-rw-r--r--contrib/package/luci-splash/src/luci_splash.init17
1 files changed, 9 insertions, 8 deletions
diff --git a/contrib/package/luci-splash/src/luci_splash.init b/contrib/package/luci-splash/src/luci_splash.init
index 049d121ea5..150f846f2f 100644
--- a/contrib/package/luci-splash/src/luci_splash.init
+++ b/contrib/package/luci-splash/src/luci_splash.init
@@ -19,14 +19,15 @@ iface_add() {
eval "$(ipcalc.sh $ipaddr $netmask)"
- iptables -t nat -A luci_splash -i "$iface" -s "$IP/$PREFIX" -j luci_splash_portal
+ iptables -t nat -A luci_splash -i "$iface" -s "$IP/$PREFIX" -j luci_splash_portal
+ iptables -t nat -A luci_splash_portal -i "$iface" -s "$IP/$PREFIX" -d "$ipaddr" -p tcp --dport 80 -j RETURN
}
blacklist_add() {
local cfg="$1"
config_get mac "$cfg" mac
- [ -n "$mac" ] && iptables -t nat -A luci_splash_portal -m mac --mac-source "$mac" -j REJECT
+ [ -n "$mac" ] && iptables -t nat -A luci_splash_portal -m mac --mac-source "$mac" -j DROP
}
whitelist_add() {
@@ -57,13 +58,13 @@ start() {
### Build the leases rule
iptables -t nat -A luci_splash_leases -p tcp --dport 80 -j REDIRECT --to-ports 8082
- iptables -t nat -A luci_splash_leases -j REJECT
+ iptables -t nat -A luci_splash_leases -j DROP
### Start the splash httpd
httpd -c /etc/luci_splash_httpd.conf -p 8082 -h /usr/lib/luci_splash/htdocs
### Sync leases
- /usr/lib/luci_splash/sync.lua
+ /usr/lib/luci-splash/sync.lua
### Hook in the chain
iptables -t nat -A prerouting_rule -j luci_splash
@@ -74,13 +75,13 @@ stop() {
iptables -t nat -D prerouting_rule -j luci_splash
### Clear subchains
- iptables -t nat -F luci_splash
- iptables -t nat -F luci_splash_portal
iptables -t nat -F luci_splash_leases
+ iptables -t nat -F luci_splash_portal
+ iptables -t nat -F luci_splash
### Delete subchains
- iptables -t nat -X luci_splash
- iptables -t nat -X luci_splash_portal
iptables -t nat -X luci_splash_leases
+ iptables -t nat -X luci_splash_portal
+ iptables -t nat -X luci_splash
}