From 97867eae9df8201c1408000e7160749f76d60bcb Mon Sep 17 00:00:00 2001 From: sbwml Date: Mon, 15 Apr 2024 16:00:52 +0800 Subject: [PATCH] luci-app-mosdns: fix the problem of non-github links being proxy Signed-off-by: sbwml --- luci-app-mosdns/Makefile | 2 +- luci-app-mosdns/root/usr/share/mosdns/mosdns.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/luci-app-mosdns/Makefile b/luci-app-mosdns/Makefile index 7e0be77..13e9982 100644 --- a/luci-app-mosdns/Makefile +++ b/luci-app-mosdns/Makefile @@ -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 diff --git a/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh b/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh index 13320f2..a8fb606 100755 --- a/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh +++ b/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh @@ -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"