From 20af55299c43c51dae6a247316d1599b46192489 Mon Sep 17 00:00:00 2001
From: Pawel Krawczyk
Date: Wed, 26 Nov 2014 10:25:03 +0000
Subject: [PATCH] wc bug and file name bug
---
blacklist.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/blacklist.sh b/blacklist.sh
index 336a5c5..49434bf 100644
--- a/blacklist.sh
+++ b/blacklist.sh
@@ -42,7 +42,7 @@ iptables -F ${blocklist_chain_name}
for url in $urls; do
# initialize temp files
- raw_blocklist=$(mktemp)
+ unsorted_blocklist=$(mktemp)
sorted_blocklist=$(mktemp)
new_set_file=$(mktemp)
@@ -53,7 +53,7 @@ for url in $urls; do
# calculate performance parameters for the new set
tmp_set_name="${set_name}_tmp"
- new_list_size=$(wc -l "${sorted_blocklist}")
+ new_list_size=$(wc -l "${sorted_blocklist}" | awk '{print $1;}' )
hash_size=$(expr $new_list_size / 2)
# start writing new set file