~修复本地安装报错的bug
~手动上传内核时,增加报错机制
This commit is contained in:
juewuy
2023-01-20 14:54:46 +08:00
parent 15461b3fdd
commit 4124a2e458
2 changed files with 26 additions and 19 deletions

View File

@@ -98,8 +98,9 @@ ckstatus(){
#检查执行权限 #检查执行权限
[ ! -x $clashdir/start.sh ] && chmod +x $clashdir/start.sh [ ! -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) [ -f /tmp/clash*linux* ] && chmod +x /tmp/clash*linux* && {
[ -n "$tmp_version" ] && { tmp_version=$(/tmp/clash*linux* -v)
if [ -n "$tmp_version" ];then
echo -e "\033[32m发现可用的内核文件\033[0m" echo -e "\033[32m发现可用的内核文件\033[0m"
read -p "是否加载?(1/0) > " res read -p "是否加载?(1/0) > " res
[ "$res" = 1 ] && { [ "$res" = 1 ] && {
@@ -114,8 +115,14 @@ ckstatus(){
esac esac
mv -f /tmp/clash*linux* $bindir/clash mv -f /tmp/clash*linux* $bindir/clash
setconfig clashcore $clashcore setconfig clashcore $clashcore
echo -----------------------------------------------
} }
else
echo -e "\033[33m检测到不可用的内核文件可能是文件受损或CPU架构不匹配\033[0m"
rm -rf /tmp/clash*linux*
echo -e "\033[33m内核文件已移除请认真检查后重新上传\033[0m"
sleep 3
fi
echo -----------------------------------------------
} }
[ -f /tmp/*.*ml ] && { [ -f /tmp/*.*ml ] && {
echo -e "\033[32m发现可用的YAML配置文件\033[0m" echo -e "\033[32m发现可用的YAML配置文件\033[0m"

View File

@@ -140,7 +140,7 @@ $clashdir/start.sh stop 2>/dev/null #防止进程冲突
} }
#移动文件 #移动文件
mkdir -p $clashdir mkdir -p $clashdir
[ -f /tmp/SC_tmp/* ] && mv -f /tmp/SC_tmp/* $clashdir mv -f /tmp/SC_tmp/* $clashdir 2>/dev/null
#初始化 #初始化
[ -f "$clashdir/mark" ] || echo '#ShellClash配置文件不明勿动' > $clashdir/mark [ -f "$clashdir/mark" ] || echo '#ShellClash配置文件不明勿动' > $clashdir/mark