luci-app-mosdns: use ghproxy.com acceleration mirrors
This commit is contained in:
parent
aa24fdeb3e
commit
e0b5708812
@ -90,11 +90,11 @@ adblock.default = false
|
||||
|
||||
adblock = s:option(Value, "ad_source", translate("ADblock Source"))
|
||||
adblock:depends("adblock", "1")
|
||||
adblock.default = "https://raw.cooluc.com/privacy-protection-tools/anti-AD/master/anti-ad-domains.txt"
|
||||
adblock.default = "https://raw.githubusercontent.com/privacy-protection-tools/anti-AD/master/anti-ad-domains.txt"
|
||||
adblock:value("geosite.dat", "v2ray-geosite")
|
||||
adblock:value("https://raw.cooluc.com/privacy-protection-tools/anti-AD/master/anti-ad-domains.txt", "anti-AD")
|
||||
adblock:value("https://raw.cooluc.com/sjhgvr/oisd/main/dbl_basic.txt", "oisd (basic)")
|
||||
adblock:value("https://raw.cooluc.com/QiuSimons/openwrt-mos/master/dat/serverlist.txt", "QiuSimons/openwrt-mos")
|
||||
adblock:value("https://raw.githubusercontent.com/privacy-protection-tools/anti-AD/master/anti-ad-domains.txt", "anti-AD")
|
||||
adblock:value("https://raw.githubusercontent.com/sjhgvr/oisd/main/dbl_basic.txt", "oisd (basic)")
|
||||
adblock:value("https://raw.githubusercontent.com/QiuSimons/openwrt-mos/master/dat/serverlist.txt", "QiuSimons/openwrt-mos")
|
||||
|
||||
reload_service = s:option( Button, "_reload", translate("Reload Service"), translate("Reload service to take effect of new configuration"))
|
||||
reload_service.write = function()
|
||||
|
@ -41,8 +41,10 @@ adlist_update() (
|
||||
ad_source=$(uci -q get mosdns.config.ad_source)
|
||||
[ $ad_source = "geosite.dat" ] && exit 0
|
||||
AD_TMPDIR=$(mktemp -d) || exit 1
|
||||
echo -e "\e[1;32mDownloading "$ad_source\e[0m"
|
||||
curl --connect-timeout 60 -m 90 --ipv4 -fSLo "$AD_TMPDIR/adlist.txt" "$ad_source"
|
||||
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$ad_source\e[0m"
|
||||
curl --connect-timeout 60 -m 90 --ipv4 -fSLo "$AD_TMPDIR/adlist.txt" "$mirror$ad_source"
|
||||
if [ $? -ne 0 ]; then
|
||||
rm -rf $AD_TMPDIR
|
||||
exit 1
|
||||
@ -55,7 +57,7 @@ adlist_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://github.cooluc.com/"
|
||||
[ $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 -fSLo "$TMPDIR/$1" ""$mirror"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/$1"
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user