From 93f24a3417b37f43891bb19e52aaddd48e3d29cc Mon Sep 17 00:00:00 2001 From: juewuy Date: Sun, 15 Dec 2024 13:28:51 +0800 Subject: [PATCH] =?UTF-8?q?~=E5=BD=93=E4=B8=BA=E8=AE=BE=E7=BD=AE=E9=BB=98?= =?UTF-8?q?=E8=AE=A4dns=E4=B8=94=E7=B3=BB=E7=BB=9F=E4=B8=AD=E5=AD=98?= =?UTF-8?q?=E5=9C=A8dnsmasq=E6=9C=8D=E5=8A=A1=E6=97=B6=EF=BC=8C=E7=8E=B0?= =?UTF-8?q?=E5=9C=A8=E7=BC=BA=E7=9C=81dns=E8=B0=83=E6=95=B4=E4=B8=BA?= =?UTF-8?q?=E6=9C=AC=E6=9C=BA53=E7=AB=AF=E5=8F=A3=E8=80=8C=E4=B8=8D?= =?UTF-8?q?=E6=98=AF114=E5=92=8C223?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/start.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/start.sh b/scripts/start.sh index 8fb4081..f4f6dc2 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -49,6 +49,15 @@ getconfig() { #读取配置及全局变量 #检查$iptable命令可用性 ckcmd iptables && iptables -h | grep -q '\-w' && iptable='iptables -w' || iptable=iptables ckcmd ip6tables && ip6tables -h | grep -q '\-w' && ip6table='ip6tables -w' || ip6table=ip6tables + #默认dns + [ -z "$dns_nameserver" ] && { + if [ -n "$(pidof dnsmasq)" ];then + dns_nameserver='127.0.0.1' + else + dns_nameserver='114.114.114.114, 223.5.5.5' + fi + } + [ -z "$dns_fallback" ] && dns_fallback='1.0.0.1, 8.8.4.4' } setconfig() { #脚本配置工具 #参数1代表变量名,参数2代表变量值,参数3即文件路径 @@ -359,8 +368,6 @@ get_core_config() { #下载内核配置文件 } modify_yaml() { #修饰clash配置文件 ##########需要变更的配置########### - [ -z "$dns_nameserver" ] && dns_nameserver='114.114.114.114, 223.5.5.5' - [ -z "$dns_fallback" ] && dns_fallback='1.0.0.1, 8.8.4.4' [ -z "$skip_cert" ] && skip_cert=已开启 [ "$ipv6_dns" = "已开启" ] && dns_v6='true' || dns_v6='false' external="external-controller: 0.0.0.0:$db_port"