banip: update 0.3.7

* fix a logical glitch in the hotplug event handler
* properly handle fatal iptables errors - even in subshells

Signed-off-by: Dirk Brenken <dev@brenken.org>
(cherry picked from commit 49b43b81e8)
This commit is contained in:
Dirk Brenken
2019-11-08 18:40:30 +01:00
parent 848589d758
commit 7a1f32f704
3 changed files with 51 additions and 26 deletions
+5 -4
View File
@@ -1,11 +1,12 @@
#!/bin/sh
#
[ "${ACTION}" != "add" ] && exit 0
ban_pidfile="/var/run/banip.pid"
ban_enabled="$(/etc/init.d/banip enabled; printf "%u" "${?}")"
if [ "${ban_enabled}" = "1" ] || [ ! -f "${ban_pidfile}" ] || [ -s "${ban_pidfile}" ] || [ "${ACTION}" != "add" ]
if [ "${ban_enabled}" = "0" ] && [ ! -s "${ban_pidfile}" ]
then
exit 0
else
/etc/init.d/banip refresh
fi
exit 0