From 173f4db0f945eb0de47c7f73455325bbfb1cdfdc Mon Sep 17 00:00:00 2001
From: Pawel Krawczyk
Date: Mon, 18 May 2015 15:49:01 +0100
Subject: [PATCH] add "nolog" option
---
blacklist.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/blacklist.sh b/blacklist.sh
index 1f1f96e..8ff3a81 100755
--- a/blacklist.sh
+++ b/blacklist.sh
@@ -111,7 +111,9 @@ for url in $urls; do
# actually execute the set update
ipset -! -q restore < "${new_set_file}"
- 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} "
+ if [ "$1" != "nolog" ]; 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
# clean up temp files