luci-app-mosdns: mosdns.sh: use geoip-only-cn-private for geodat_update
This commit is contained in:
parent
b8ac086a54
commit
21c4be1aeb
@ -64,18 +64,17 @@ adlist_update() (
|
|||||||
)
|
)
|
||||||
|
|
||||||
geodat_update() (
|
geodat_update() (
|
||||||
geodat_download() (
|
|
||||||
google_status=$(curl -I -4 -m 3 -o /dev/null -s -w %{http_code} http://www.google.com/generate_204)
|
|
||||||
[ "$google_status" -ne "204" ] && mirror="https://ghproxy.com/"
|
|
||||||
echo -e "\e[1;32mDownloading "$mirror"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/$1\e[0m"
|
|
||||||
curl --connect-timeout 60 -m 900 --ipv4 -kfSLo "$TMPDIR/$1" ""$mirror"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/$1"
|
|
||||||
)
|
|
||||||
TMPDIR=$(mktemp -d) || exit 1
|
TMPDIR=$(mktemp -d) || exit 1
|
||||||
geodat_download geoip.dat && geodat_download geosite.dat
|
google_status=$(curl -I -4 -m 3 -o /dev/null -s -w %{http_code} http://www.google.com/generate_204)
|
||||||
if [ $? -ne 0 ]; then
|
[ "$google_status" -ne "204" ] && mirror="https://ghproxy.com/"
|
||||||
rm -rf "$TMPDIR"
|
# geoip.dat - cn-private
|
||||||
exit 1
|
echo -e "\e[1;32mDownloading "$mirror"https://github.com/Loyalsoldier/geoip/releases/latest/download/geoip-only-cn-private.dat\e[0m"
|
||||||
fi
|
curl --connect-timeout 60 -m 900 --ipv4 -kfSLo "$TMPDIR/geoip.dat" ""$mirror"https://github.com/Loyalsoldier/geoip/releases/latest/download/geoip-only-cn-private.dat"
|
||||||
|
[ $? -ne 0 ] && rm -rf "$TMPDIR" && exit 1
|
||||||
|
# geosite.dat
|
||||||
|
echo -e "\e[1;32mDownloading "$mirror"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat\e[0m"
|
||||||
|
curl --connect-timeout 60 -m 900 --ipv4 -kfSLo "$TMPDIR/geosite.dat" ""$mirror"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat"
|
||||||
|
[ $? -ne 0 ] && rm -rf "$TMPDIR" && exit 1
|
||||||
cp -f "$TMPDIR"/* /usr/share/v2ray
|
cp -f "$TMPDIR"/* /usr/share/v2ray
|
||||||
rm -rf "$TMPDIR"
|
rm -rf "$TMPDIR"
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user