From 75cee0fdfe752c7e454f4d281c15791c2549bd7b Mon Sep 17 00:00:00 2001
From: Pawel Krawczyk
Date: Mon, 18 May 2015 15:50:15 +0100
Subject: [PATCH] only log if "log" option given
---
blacklist.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/blacklist.sh b/blacklist.sh
index 8ff3a81..98edcf6 100755
--- a/blacklist.sh
+++ b/blacklist.sh
@@ -111,7 +111,7 @@ for url in $urls; do
# actually execute the set update
ipset -! -q restore < "${new_set_file}"
- if [ "$1" != "nolog" ]; then
+ if [ "$1" = "log" ]; then
iptables -A ${blocklist_chain_name} -m set --match-set "${set_name}" src,dst -m limit --limit 10/minute -j LOG --log-prefix "BLOCK ${set_name} "
fi
iptables -A ${blocklist_chain_name} -m set --match-set "${set_name}" src,dst -j DROP