applications/luci-splash: prevent duplicate firewall rules after boot
This commit is contained in:
parent
9473eb8b0d
commit
df3d84780e
1 changed files with 11 additions and 6 deletions
|
@ -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
|
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() {
|
blacklist_add() {
|
||||||
local cfg="$1"
|
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
|
[ -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() {
|
start() {
|
||||||
### Read chains from config
|
### Read chains from config
|
||||||
include /lib/network
|
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
|
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() {
|
stop() {
|
||||||
### Clear interface rules
|
### Clear interface rules
|
||||||
config_load luci_splash
|
config_load luci_splash
|
||||||
|
|
Loading…
Reference in a new issue