luci-app-mosdns: fix the problem of non-github links being proxy

Signed-off-by: sbwml <admin@cooluc.com>
This commit is contained in:
sbwml 2024-04-15 16:00:52 +08:00
parent 49051dbca3
commit 97867eae9d
2 changed files with 3 additions and 2 deletions

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-mosdns
PKG_VERSION:=1.5.19
PKG_VERSION:=1.5.20
PKG_RELEASE:=1
LUCI_TITLE:=LuCI Support for mosdns

View File

@ -56,7 +56,6 @@ adlist_update() {
[ "$(uci -q get mosdns.config.adblock)" != 1 ] && return 0
lock_file=/var/lock/mosdns_ad_update.lock
ad_source=$(uci -q get mosdns.config.ad_source)
mirror=""
: > /etc/mosdns/rule/.ad_source
if [ -f "$lock_file" ]; then
has_update=0
@ -74,6 +73,8 @@ adlist_update() {
filename=$(basename $url)
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)/"
else
mirror=""
fi
echo -e "\e[1;32mDownloading $mirror$url\e[0m"
curl --connect-timeout 5 -m 90 --ipv4 -kfSLo "$AD_TMPDIR/$filename" "$mirror$url"