Merge pull request #1 from AlexLaroche/master
Fix problems in the script for Openwrt
This commit is contained in:
commit
c3c83c5092
10
blacklist.sh
10
blacklist.sh
@ -83,7 +83,6 @@ else
|
||||
FORWARD=FORWARD
|
||||
fi
|
||||
|
||||
|
||||
# create main blocklists chain
|
||||
if ! iptables -L | grep -q "Chain ${blocklist_chain_name}"; then
|
||||
iptables -N ${blocklist_chain_name}
|
||||
@ -107,10 +106,11 @@ set_name="manual-blacklist"
|
||||
if ! ipset list | grep -q "Name: ${set_name}"; then
|
||||
ipset create "${set_name}" hash:net
|
||||
fi
|
||||
link_set("${blocklist_chain_name}", "${blocklist_chain_name}", "$3")
|
||||
link_set "${blocklist_chain_name}" "${set_name}" "$3"
|
||||
|
||||
# download and process the dynamic blacklists
|
||||
for url in $urls; do
|
||||
for url in $URLS
|
||||
do
|
||||
# initialize temp files
|
||||
unsorted_blocklist=$(mktemp)
|
||||
sorted_blocklist=$(mktemp)
|
||||
@ -176,10 +176,8 @@ for url in $urls; do
|
||||
# actually execute the set update
|
||||
ipset -! -q restore < "${new_set_file}"
|
||||
|
||||
link_set("${blocklist_chain_name}", "${blocklist_chain_name}", "$3")
|
||||
link_set "${blocklist_chain_name}" "${set_name}" "$3"
|
||||
|
||||
# clean up temp files
|
||||
rm "${unsorted_blocklist}" "${sorted_blocklist}" "${new_set_file}" "${headers}"
|
||||
done
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user