From 9687748b85e9f3e50e90e21e4c32666d0f4a25e7 Mon Sep 17 00:00:00 2001 From: juewuy Date: Tue, 3 Nov 2020 16:50:10 +0800 Subject: [PATCH] =?UTF-8?q?v1.0.0beta16.4=20~=E5=A2=9E=E5=8A=A0mac?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E7=99=BD=E5=90=8D=E5=8D=95=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=20~=E5=B1=8F=E8=94=BD=E4=B8=8D=E4=BD=BF=E7=94=A8=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0dns=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=A6=82=E6=9C=89?= =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8F=AF=E5=9C=A8dns=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=B8=AD=E8=87=AA=E8=A1=8C=E7=BC=96=E8=BE=91=20~=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E4=BD=BF=E7=94=A8=E8=87=AA=E5=AE=9A=E4=B9=89=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=8A=9F=E8=83=BD=EF=BC=8C=E7=8E=B0=E5=9C=A8=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E6=89=8B=E5=8A=A8=E5=B0=86=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=86=99=E5=85=A5user.yaml=E3=80=81=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E8=A7=84=E5=88=99=E5=86=99=E5=85=A5rules.yam?= =?UTF-8?q?l,=E8=BF=90=E8=A1=8C=E6=97=B6=E4=BC=9A=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=20~?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=BE=E7=BD=AEhttp=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E5=8A=A0=E5=AF=86=E5=90=8E=E5=AF=BC=E8=87=B4=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E5=A4=B1=E8=B4=A5=E7=9A=84bug=20~=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=B7=BB=E5=8A=A03=E4=B8=AA=E4=BB=A5=E4=B8=8Adns?= =?UTF-8?q?=E6=97=B6=E6=B7=BB=E5=8A=A0=E5=A4=B1=E8=B4=A5=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/clash.sh | 4 ++-- scripts/start.sh | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/clash.sh b/scripts/clash.sh index d9de37d..3723317 100644 --- a/scripts/clash.sh +++ b/scripts/clash.sh @@ -244,14 +244,14 @@ setdns(){ clashadv elif [ "$num" = 1 ]; then read -p "请输入新的DNS > " dns_nameserver - dns_nameserver=$(echo $dns_nameserver | sed 's/|/\,\ /') + dns_nameserver=$(echo $dns_nameserver | sed 's/|/\,\ /g') if [ -n "$dns_nameserver" ]; then setconfig dns_nameserver \'$dns_nameserver\' echo -e "\033[32m设置成功!!!\033[0m" fi elif [ "$num" = 2 ]; then read -p "请输入新的DNS > " dns_fallback - dns_fallback=$(echo $dns_fallback | sed 's/|/\,\ /') + dns_fallback=$(echo $dns_fallback | sed 's/|/\,\ /g') if [ -n "$dns_fallback" ]; then setconfig dns_fallback \'$dns_fallback\' echo -e "\033[32m设置成功!!!\033[0m" diff --git a/scripts/start.sh b/scripts/start.sh index 86ba08c..d143eda 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -218,9 +218,9 @@ modify_yaml(){ b=$(grep -n "^prox" $yaml | head -1 | cut -d ":" -f 1) b=$((b-1)) mkdir -p $tmpdir > /dev/null - sed "${a},${b}d" $yaml > $tmpdir/rule.yaml + sed "${a},${b}d" $yaml > $tmpdir/proxy.yaml #跳过本地tls证书验证 - [ "$skip_cert" = "已开启" ] && sed -i '10,99s/skip-cert-verify: false/skip-cert-verify: true/' $tmpdir/rule.yaml + [ "$skip_cert" = "已开启" ] && sed -i '10,99s/skip-cert-verify: false/skip-cert-verify: true/' $tmpdir/proxy.yaml #添加配置 cat > $tmpdir/set.yaml < $tmpdir/config.yaml + [ -f $clashdir/rules.yaml ] && yaml_rules=$clashdir/rules.yaml + cat $tmpdir/set.yaml $yaml_user $tmpdir/proxy.yaml $yaml_rules > $tmpdir/config.yaml if [ "$tmpdir" != "$bindir" ];then #如果没有使用小闪存模式 cmp -s $tmpdir/config.yaml $yaml [ "$?" != 0 ] && mv -f $tmpdir/config.yaml $yaml || rm -f $tmpdir/config.yaml fi rm -f $tmpdir/set.yaml - rm -f $tmpdir/rule.yaml + rm -f $tmpdir/proxy.yaml } #设置路由规则 start_redir(){