cosmetic
This commit is contained in:
parent
ca1ed35f92
commit
eb5c563fb0
@ -37,10 +37,10 @@ fi
|
|||||||
if ! iptables -L ${blocklist_chain_name}; then iptables -N ${blocklist_chain_name}; fi
|
if ! iptables -L ${blocklist_chain_name}; then iptables -N ${blocklist_chain_name}; fi
|
||||||
|
|
||||||
# inject references to blocklist in the beginning of input and forward chains
|
# inject references to blocklist in the beginning of input and forward chains
|
||||||
if ! iptables -L input_rule |grep -q ${blocklist_chain_name}; then
|
if ! iptables -L input_rule | grep -q ${blocklist_chain_name}; then
|
||||||
iptables -I input_rule 1 -m state --state NEW,RELATED -j ${blocklist_chain_name}
|
iptables -I input_rule 1 -m state --state NEW,RELATED -j ${blocklist_chain_name}
|
||||||
fi
|
fi
|
||||||
if ! iptables -L forwarding_rule |grep -q ${blocklist_chain_name}; then
|
if ! iptables -L forwarding_rule | grep -q ${blocklist_chain_name}; then
|
||||||
iptables -I forwarding_rule 1 -m state --state NEW,RELATED -j ${blocklist_chain_name}
|
iptables -I forwarding_rule 1 -m state --state NEW,RELATED -j ${blocklist_chain_name}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ for url in $urls; do
|
|||||||
set_name=$(basename $url)
|
set_name=$(basename $url)
|
||||||
curl -s -k "$url" >"$tmp"
|
curl -s -k "$url" >"$tmp"
|
||||||
sort -u <"$tmp" | egrep "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$" >"$tmp2"
|
sort -u <"$tmp" | egrep "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$" >"$tmp2"
|
||||||
ipset create ${set_name} hash:net
|
ipset -! create ${set_name} hash:net
|
||||||
while read line; do
|
while read line; do
|
||||||
ipset -! add ${set_name} "$line"
|
ipset -! add ${set_name} "$line"
|
||||||
done <"$tmp2"
|
done <"$tmp2"
|
||||||
|
Loading…
Reference in New Issue
Block a user