mirror of
https://github.com/itdoginfo/ansible-openwrt-hirkn.git
synced 2026-03-24 03:08:34 +05:00
ограничение количества попыток скачки списка доменов
This commit is contained in:
@@ -22,7 +22,12 @@ start () {
|
||||
DOMAINS=https://raw.githubusercontent.com/itdoginfo/allow-domains/main/Ukraine/inside-dnsmasq-ipset.lst
|
||||
{% endif %}
|
||||
count=0
|
||||
maxCount=10
|
||||
while true; do
|
||||
if [ ${count} -eq ${maxCount} ]; then
|
||||
echo "Break on ${maxCount} attempt"
|
||||
break
|
||||
fi
|
||||
if curl -m 3 github.com; then
|
||||
curl -f $DOMAINS --output /tmp/dnsmasq.d/domains.lst
|
||||
break
|
||||
@@ -46,7 +51,12 @@ start () {
|
||||
mkdir -p $dir
|
||||
|
||||
count=0
|
||||
maxCount=10
|
||||
while true; do
|
||||
if [ ${count} -eq ${maxCount} ]; then
|
||||
echo "Break on ${maxCount} attempt"
|
||||
break
|
||||
fi
|
||||
if curl -m 3 https://antifilter.download/; then
|
||||
{% if list_subnet %}
|
||||
curl -f -z $dir/subnet.lst https://antifilter.download/list/subnet.lst --output $dir/subnet.lst
|
||||
@@ -56,7 +66,7 @@ start () {
|
||||
{% endif %}
|
||||
{% if list_community %}
|
||||
curl -f -z $dir/community.lst https://community.antifilter.download/list/community.lst --output $dir/community.lst
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
break
|
||||
else
|
||||
echo "antifilter.download is not available. Check the internet availability [$count]"
|
||||
@@ -66,5 +76,5 @@ start () {
|
||||
|
||||
echo "Firewall restart"
|
||||
/etc/init.d/firewall restart
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
}
|
||||
Reference in New Issue
Block a user