From ed09f893acbe791b114e615bbb62d4006680b7d3 Mon Sep 17 00:00:00 2001 From: Bard Date: Wed, 15 Nov 2023 22:28:55 +0800 Subject: [PATCH] luci-app-mosdns: mosdns.sh: fix execution sequence Signed-off-by: sbwml --- luci-app-mosdns/root/usr/share/mosdns/mosdns.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh b/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh index d8c0302..eb6411b 100755 --- a/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh +++ b/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh @@ -62,6 +62,7 @@ adlist_update() { for url in $ad_source; do if [ "$url" != "geosite.dat" ] && [ $(echo "$url" | grep -c -E "^file://") -eq 0 ]; then + has_update=1 echo "$url" >> /etc/mosdns/rule/.ad_source filename=$(basename $url) if echo "$url" | grep -Eq "^https://raw.githubusercontent.com" ; then @@ -69,7 +70,6 @@ adlist_update() { fi echo -e "\e[1;32mDownloading $mirror$url\e[0m" curl --connect-timeout 5 -m 90 --ipv4 -kfSLo "$AD_TMPDIR/$filename" "$mirror$url" - has_update=1 fi done if [ $? -ne 0 ]; then @@ -81,9 +81,9 @@ adlist_update() { mkdir -p /etc/mosdns/rule/adlist rm -rf /etc/mosdns/rule/adlist/* \cp $AD_TMPDIR/* /etc/mosdns/rule/adlist - rm -rf "$AD_TMPDIR" } fi + rm -rf "$AD_TMPDIR" } geodat_update() (