From edd054d63e1923a678f3f6e87f433823f70f8f8d Mon Sep 17 00:00:00 2001
From: Pawel Krawczyk
Date: Thu, 2 Oct 2014 11:09:25 +0100
Subject: [PATCH] use which to find binaries
---
blacklist.sh | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/blacklist.sh b/blacklist.sh
index edfdeef..ffb0f59 100644
--- a/blacklist.sh
+++ b/blacklist.sh
@@ -13,12 +13,18 @@ urls="$urls https://www.blocklist.de/downloads/export-ips_all.txt"
blocklist_chain_name=blocklists
-if [ ! -x /usr/sbin/ipset ]; then
+if [ $(which ipset) ]; then
echo "Cannot find ipset"
echo "Run \"apt-get install ipset\" or \"yum install ipset\""
exit 1
fi
+if [ $(which curl) ]; then
+ echo "Cannot find curl"
+ echo "Run \"apt-get install curl\" or \"yum install curl\""
+ exit 1
+fi
+
# create main blocklists chain
if ! iptables -L ${blocklist_chain_name}; then iptables -N ${blocklist_chain_name}; fi