diff --git a/root/usr/share/mosdns/dns.sh b/root/usr/share/mosdns/dns.sh index 7aed934..bfa885d 100755 --- a/root/usr/share/mosdns/dns.sh +++ b/root/usr/share/mosdns/dns.sh @@ -7,10 +7,12 @@ if [ "$(ifconfig | grep -c wan)" = 0 ]; then exit 0 fi -if [[ "$(getdns 0)" =~ ^127\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - getdns "$1" inactive -elif [[ "$(getdns "$1")" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - getdns "$1" -else - bakdns "$1" +if [ $1 ]; then + if [[ "$(getdns 0)" =~ ^127\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + getdns "$1" inactive + elif [[ "$(getdns "$1")" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + getdns "$1" + else + bakdns "$1" + fi fi diff --git a/root/usr/share/mosdns/library.sh b/root/usr/share/mosdns/library.sh index 3da7e6d..76409bb 100755 --- a/root/usr/share/mosdns/library.sh +++ b/root/usr/share/mosdns/library.sh @@ -14,9 +14,9 @@ exist() { getdat() { if exist curl; then - curl -fSLo "$TMPDIR/$1" "https://github.sbwml.repl.co/https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/$1" + curl -fSLo "$TMPDIR/$1" "https://github.cooluc.com/https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/$1" else - wget "https://github.sbwml.repl.co/https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/$1" -nv -O "$TMPDIR/$1" + wget "https://github.cooluc.com/https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/$1" -nv -O "$TMPDIR/$1" fi }