mirror of
https://github.com/novatiq/packages.git
synced 2026-04-28 06:44:40 +01:00
49e57eadb3
* limit firewall hotplug trigger to certain wan 'INTERFACE' as well,
to prevent possible race conditions during boot
Signed-off-by: Dirk Brenken <dev@brenken.org>
(cherry picked from commit 0dee2a92de)
16 lines
410 B
Bash
16 lines
410 B
Bash
#!/bin/sh
|
|
#
|
|
[ "${ACTION}" != "add" ] && exit 0
|
|
|
|
ban_iface="wan"
|
|
[ -r "/lib/functions/network.sh" ] && { . "/lib/functions/network.sh"; network_find_wan ban_iface; }
|
|
[ "${INTERFACE}" != "${ban_iface}" ] && exit 0
|
|
|
|
ban_pidfile="/var/run/banip.pid"
|
|
ban_enabled="$(/etc/init.d/banip enabled; printf "%u" "${?}")"
|
|
if [ "${ban_enabled}" = "0" ] && [ ! -s "${ban_pidfile}" ]
|
|
then
|
|
/etc/init.d/banip refresh
|
|
fi
|
|
exit 0
|