From 4e6da933faed7a43e0d6a909074e966ddb0295bd Mon Sep 17 00:00:00 2001 From: Pawel Krawczyk Date: Wed, 26 Nov 2014 10:21:19 +0000 Subject: [PATCH] append, not overwrite --- blacklist.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/blacklist.sh b/blacklist.sh index 6420980..336a5c5 100644 --- a/blacklist.sh +++ b/blacklist.sh @@ -57,16 +57,16 @@ for url in $urls; do hash_size=$(expr $new_list_size / 2) # start writing new set file - echo "destroy ${tmp_set_name}" >"${new_set_file}" # clean up any left overs - echo "create ${tmp_set_name} hash:net family inet hashsize ${hash_size} maxelem ${new_list_size}" >"${new_set_file}" + echo "destroy ${tmp_set_name}" >>"${new_set_file}" # clean up any left overs + echo "create ${tmp_set_name} hash:net family inet hashsize ${hash_size} maxelem ${new_list_size}" >>"${new_set_file}" # convert list of IPs to ipset statements while read line; do - echo "add ${tmp_set_name} ${line}" >"${new_set_file}" + echo "add ${tmp_set_name} ${line}" >>"${new_set_file}" done <"$sorted_blocklist" - echo "swap ${tmp_set_name} ${set_name}" >"${new_set_file}" # insert new blocklist into the old set - echo "destroy ${tmp_set_name}" >"${new_set_file}" # remove old set + echo "swap ${tmp_set_name} ${set_name}" >>"${new_set_file}" # insert new blocklist into the old set + echo "destroy ${tmp_set_name}" >>"${new_set_file}" # remove old set # actually execute the set update ipset restore < "${new_set_file}"