From fa9c890701951c5f25d835acb5086f87acd1e3f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AE=A1=E5=AD=90=E5=B7=A5=E5=85=B7=E7=AE=B1?= <50480726+A7T@users.noreply.github.com> Date: Mon, 21 Jun 2021 01:23:24 +0800 Subject: [PATCH] Update clash.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BUG修复: **clash** > **7 clash进阶设置** > **6 手动指定相关端口、秘钥及本机host** > **8 指定本机host地址** ```text hostdir=':9999/ui' host=127.0.0.1 ``` 修改后的匹配方案虽然仍有不足但暂且够用。 --- scripts/clash.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/clash.sh b/scripts/clash.sh index 4a99395..49465b4 100644 --- a/scripts/clash.sh +++ b/scripts/clash.sh @@ -93,7 +93,7 @@ getconfig(){ setconfig(){ #参数1代表变量名,参数2代表变量值,参数3即文件路径 [ -z "$3" ] && configpath=$clashdir/mark || configpath=$3 - [ -n "$(grep ${1} $configpath)" ] && sed -i "s#${1}=\(.*\)#${1}=${2}#g" $configpath || echo "${1}=${2}" >> $configpath + [ -n "$(grep ${1}= $configpath)" ] && sed -i "s#${1}=\(.*\)#${1}=${2}#g" $configpath || echo "${1}=${2}" >> $configpath } #启动相关 errornum(){