mirror of
https://github.com/AdguardTeam/AdGuardDNS.git
synced 2025-02-20 11:23:36 +08:00
don't download filter rules if file already exists
This commit is contained in:
parent
32de112d97
commit
e28703b7b8
@ -13,14 +13,20 @@ case "$1" in
|
|||||||
--gecos "<%= project %> user" \
|
--gecos "<%= project %> user" \
|
||||||
--shell /bin/bash "<%= user %>"
|
--shell /bin/bash "<%= user %>"
|
||||||
fi
|
fi
|
||||||
URL="https://filters.adtidy.org/android/filters/15.txt"
|
|
||||||
OUTFILE="/var/lib/dnsfilter/dns.txt"
|
OUTFILE="/var/lib/dnsfilter/dns.txt"
|
||||||
|
|
||||||
mkdir -p /var/lib/dnsfilter
|
if [ ! -f "${OUTFILE}" ]; then
|
||||||
wget -q --timeout=90 "$URL" -O "$OUTFILE"
|
echo "${OUTFILE} does not exists. Downloading..."
|
||||||
if [ $? -ne 0 ]
|
|
||||||
then
|
URL="https://filters.adtidy.org/android/filters/15.txt"
|
||||||
echo "Filter rules could not be downloaded."
|
|
||||||
|
mkdir -p /var/lib/dnsfilter
|
||||||
|
wget -q --timeout=90 "$URL" -O "$OUTFILE"
|
||||||
|
if [ $? -ne 0 ]
|
||||||
|
then
|
||||||
|
echo "Filter rules could not be downloaded."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user