From 47b398a778543be4c7fd91adb7a3a0cc8cbeb206 Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Tue, 20 Dec 2022 14:49:52 -0800 Subject: [PATCH] fixed, and renamed, firewall blacklist scripts --- sbin/{fbl.sh => firewall-blacklist-add.sh} | 2 +- sbin/{fwl.sh => firewall-blacklist-rem.sh} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename sbin/{fbl.sh => firewall-blacklist-add.sh} (78%) rename sbin/{fwl.sh => firewall-blacklist-rem.sh} (79%) diff --git a/sbin/fbl.sh b/sbin/firewall-blacklist-add.sh similarity index 78% rename from sbin/fbl.sh rename to sbin/firewall-blacklist-add.sh index 476e618..99d1993 100755 --- a/sbin/fbl.sh +++ b/sbin/firewall-blacklist-add.sh @@ -8,7 +8,7 @@ else exit 1 fi -if [[ firewall-cmd --ipset=blacklist --query-entry $IP >/dev/null ]]; then +if [[ `firewall-cmd --ipset=blacklist --query-entry $IP` = "yes" ]]; then echo "IP $IP already in blacklist. Doing nothing." diff --git a/sbin/fwl.sh b/sbin/firewall-blacklist-rem.sh similarity index 79% rename from sbin/fwl.sh rename to sbin/firewall-blacklist-rem.sh index ca4419f..fd0d9e6 100755 --- a/sbin/fwl.sh +++ b/sbin/firewall-blacklist-rem.sh @@ -8,7 +8,7 @@ else exit 1 fi -if [[ firewall-cmd --ipset=blacklist --query-entry $IP >/dev/null ]]; then +if [[ `firewall-cmd --ipset=blacklist --query-entry $IP` = "yes" ]]; then firewall-cmd --ipset=blacklist --remove-entry=$IP firewall-cmd --permanent --ipset=blacklist --remove-entry=$IP