Skip to content

Commit

Permalink
v1.7.0c
Browse files Browse the repository at this point in the history
~自动导入/tmp下yaml文件时增加检测机制
~修复未安装面板时启动依然提示本地面板连接信息的bug
  • Loading branch information
juewuy committed Jan 28, 2023
1 parent ac0e024 commit 7fd3d79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions scripts/clash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/getdate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 -----------------------------------------------
Expand Down

0 comments on commit 7fd3d79

Please sign in to comment.