luci-app-mosdns: fix the problem of non-github links being proxy
Signed-off-by: sbwml <admin@cooluc.com>
This commit is contained in:
parent
49051dbca3
commit
97867eae9d
@ -1,7 +1,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=luci-app-mosdns
|
PKG_NAME:=luci-app-mosdns
|
||||||
PKG_VERSION:=1.5.19
|
PKG_VERSION:=1.5.20
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
LUCI_TITLE:=LuCI Support for mosdns
|
LUCI_TITLE:=LuCI Support for mosdns
|
||||||
|
@ -56,7 +56,6 @@ adlist_update() {
|
|||||||
[ "$(uci -q get mosdns.config.adblock)" != 1 ] && return 0
|
[ "$(uci -q get mosdns.config.adblock)" != 1 ] && return 0
|
||||||
lock_file=/var/lock/mosdns_ad_update.lock
|
lock_file=/var/lock/mosdns_ad_update.lock
|
||||||
ad_source=$(uci -q get mosdns.config.ad_source)
|
ad_source=$(uci -q get mosdns.config.ad_source)
|
||||||
mirror=""
|
|
||||||
: > /etc/mosdns/rule/.ad_source
|
: > /etc/mosdns/rule/.ad_source
|
||||||
if [ -f "$lock_file" ]; then
|
if [ -f "$lock_file" ]; then
|
||||||
has_update=0
|
has_update=0
|
||||||
@ -74,6 +73,8 @@ adlist_update() {
|
|||||||
filename=$(basename $url)
|
filename=$(basename $url)
|
||||||
if echo "$url" | grep -Eq "^https://raw.githubusercontent.com" ; then
|
if echo "$url" | grep -Eq "^https://raw.githubusercontent.com" ; then
|
||||||
[ -n "$(uci -q get mosdns.config.github_proxy)" ] && mirror="$(uci -q get mosdns.config.github_proxy)/"
|
[ -n "$(uci -q get mosdns.config.github_proxy)" ] && mirror="$(uci -q get mosdns.config.github_proxy)/"
|
||||||
|
else
|
||||||
|
mirror=""
|
||||||
fi
|
fi
|
||||||
echo -e "\e[1;32mDownloading $mirror$url\e[0m"
|
echo -e "\e[1;32mDownloading $mirror$url\e[0m"
|
||||||
curl --connect-timeout 5 -m 90 --ipv4 -kfSLo "$AD_TMPDIR/$filename" "$mirror$url"
|
curl --connect-timeout 5 -m 90 --ipv4 -kfSLo "$AD_TMPDIR/$filename" "$mirror$url"
|
||||||
|
Loading…
Reference in New Issue
Block a user