From 7fd3d79669df41b13ff20bf16ff069fc0d94e42d Mon Sep 17 00:00:00 2001 From: juewuy Date: Sat, 28 Jan 2023 13:05:07 +0800 Subject: [PATCH] =?UTF-8?q?v1.7.0c=20~=E8=87=AA=E5=8A=A8=E5=AF=BC=E5=85=A5?= =?UTF-8?q?/tmp=E4=B8=8Byaml=E6=96=87=E4=BB=B6=E6=97=B6=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E6=9C=BA=E5=88=B6=20~=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=9C=AA=E5=AE=89=E8=A3=85=E9=9D=A2=E6=9D=BF=E6=97=B6=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E4=BE=9D=E7=84=B6=E6=8F=90=E7=A4=BA=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E8=BF=9E=E6=8E=A5=E4=BF=A1=E6=81=AF=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/clash.sh | 9 +++++---- scripts/getdate.sh | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/clash.sh b/scripts/clash.sh index 23c4220..1231c4d 100644 --- a/scripts/clash.sh +++ b/scripts/clash.sh @@ -44,8 +44,8 @@ ckstatus(){ [ -z "$host" ] && host=$(ip a 2>&1 | grep -w 'inet' | grep 'global' | grep -E ' 1(92|0|72)\.' | sed 's/.*inet.//g' | sed 's/\/[0-9][0-9].*$//g' | head -n 1) [ -z "$host" ] && host='设备IP地址' #dashboard目录位置 - [ -d $clashdir/ui ] && dbdir=$clashdir/ui && hostdir=":$db_port/ui" - [ -d /www/clash ] && dbdir=/www/clash && hostdir=/clash + [ -f $clashdir/ui/index.html ] && dbdir=$clashdir/ui && hostdir=":$db_port/ui" + [ -f /www/clash/index.html ] && dbdir=/www/clash && hostdir=/clash #开机自启检测 if [ -f /etc/rc.common ];then [ -n "$(find /etc/rc.d -name '*clash')" ] && autostart=enable || autostart=disable @@ -97,7 +97,7 @@ ckstatus(){ fi #检查执行权限 [ ! -x $clashdir/start.sh ] && chmod +x $clashdir/start.sh - #检查/tmp用户上传 + #检查/tmp内核文件 [ -f /tmp/clash*linux* ] && chmod +x /tmp/clash*linux* && { tmp_version=$(/tmp/clash*linux* -v) if [ -n "$tmp_version" ];then @@ -124,7 +124,8 @@ ckstatus(){ fi echo ----------------------------------------------- } - [ -f /tmp/*.*ml ] && { + #检查/tmp配置文件 + [ -f /tmp/*.*ml -a -x $bindir/clash ] && $bindir/clash -t -d $bindir -f /tmp/*.*ml &>/dev/null && { echo -e "\033[32m发现可用的YAML配置文件\033[0m" echo /tmp/*.*ml read -p "是否加载为config.yaml配置文件?(1/0) > " res diff --git a/scripts/getdate.sh b/scripts/getdate.sh index 704b600..36f90bd 100644 --- a/scripts/getdate.sh +++ b/scripts/getdate.sh @@ -554,7 +554,7 @@ setgeo(){ getdb(){ #下载及安装 - if [ -d /www/clash -o -d $clashdir/ui ];then + if [ -f /www/clash/index.html -o -f $clashdir/ui/index.html ];then echo ----------------------------------------------- echo -e "\033[31m检测到您已经安装过本地面板了!\033[0m" echo -----------------------------------------------