banip: bugfix 0.7.6-2
authorDirk Brenken <dev@brenken.org>
Sat, 3 Apr 2021 17:16:39 +0000 (19:16 +0200)
committerDirk Brenken <dev@brenken.org>
Sat, 3 Apr 2021 17:16:39 +0000 (19:16 +0200)
* fix housekeeping of external list sources

Signed-off-by: Dirk Brenken <dev@brenken.org>
net/banip/Makefile
net/banip/files/banip.sh

index a716d4c344cec40bc0f4ef1482fdb1acbdfd802a..9f0a86540b1f4f3f72ae924d99720d7b158f56c5 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=banip
 PKG_VERSION:=0.7.6
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
 
index 04812420af4d50dbad682ecb3db7f044ca3be010..5e80ee291ff8c9a29fa2ddd7d9454b2198fa8119 100755 (executable)
@@ -542,22 +542,18 @@ f_iptables()
        then
                for dev in ${ban_ipdevs}
                do
-                       if [ ! -f "${ban_tmpfile}.${src_name}.delete" ]
+                       if [ "${src_name}" = "maclist" ]
                        then
-                               > "${ban_tmpfile}.${src_name}.delete"
-                               if [ "${src_name}" = "maclist" ]
-                               then
-                                       f_iptrule "-D" "${ban_chain}" "-o ${dev} -m set --match-set ${src_name} src -j RETURN"
-                               elif [ "${src_name%_*}" = "whitelist" ]
-                               then
-                                       f_iptrule "-D" "${ban_chain}" "-i ${dev} -m set --match-set ${src_name} src -j RETURN"
-                                       f_iptrule "-D" "${ban_chain}" "-o ${dev} -m set --match-set ${src_name} dst -j RETURN"
-                               else
-                                       f_iptrule "-D" "${ban_chain}" "-i ${dev} -m set --match-set ${src_name} src -j ${ban_logtarget_src}"
-                                       f_iptrule "-D" "${ban_chain}" "-o ${dev} -m set --match-set ${src_name} dst -j ${ban_logtarget_dst}"
-                                       f_iptrule "-D" "${ban_chain}" "-i ${dev} -m set --match-set ${src_name} src -j ${ban_logchain_src}"
-                                       f_iptrule "-D" "${ban_chain}" "-o ${dev} -m set --match-set ${src_name} dst -j ${ban_logchain_dst}"
-                               fi
+                               f_iptrule "-D" "${ban_chain}" "-o ${dev} -m set --match-set ${src_name} src -j RETURN"
+                       elif [ "${src_name%_*}" = "whitelist" ]
+                       then
+                               f_iptrule "-D" "${ban_chain}" "-i ${dev} -m set --match-set ${src_name} src -j RETURN"
+                               f_iptrule "-D" "${ban_chain}" "-o ${dev} -m set --match-set ${src_name} dst -j RETURN"
+                       else
+                               f_iptrule "-D" "${ban_chain}" "-i ${dev} -m set --match-set ${src_name} src -j ${ban_logtarget_src}"
+                               f_iptrule "-D" "${ban_chain}" "-o ${dev} -m set --match-set ${src_name} dst -j ${ban_logtarget_dst}"
+                               f_iptrule "-D" "${ban_chain}" "-i ${dev} -m set --match-set ${src_name} src -j ${ban_logchain_src}"
+                               f_iptrule "-D" "${ban_chain}" "-o ${dev} -m set --match-set ${src_name} dst -j ${ban_logchain_dst}"
                        fi
                done
        fi