v1.6.16d
~修复本地安装报错的bug ~手动上传内核时,增加报错机制
This commit is contained in:
@@ -98,24 +98,31 @@ 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)
|
||||||
echo -e "\033[32m发现可用的内核文件\033[0m"
|
if [ -n "$tmp_version" ];then
|
||||||
read -p "是否加载?(1/0) > " res
|
echo -e "\033[32m发现可用的内核文件\033[0m"
|
||||||
[ "$res" = 1 ] && {
|
read -p "是否加载?(1/0) > " res
|
||||||
echo -e " 1 Clash内核"
|
[ "$res" = 1 ] && {
|
||||||
echo -e " 2 Clashpre内核"
|
echo -e " 1 Clash内核"
|
||||||
echo -e " 3 Clash.Meta内核"
|
echo -e " 2 Clashpre内核"
|
||||||
read -p "请手动确定该内核类型 > " num
|
echo -e " 3 Clash.Meta内核"
|
||||||
case "$num" in
|
read -p "请手动确定该内核类型 > " num
|
||||||
2) clashcore=clashpre ;;
|
case "$num" in
|
||||||
3) clashcore=clash.meta ;;
|
2) clashcore=clashpre ;;
|
||||||
*) clashcore=clash ;;
|
3) clashcore=clash.meta ;;
|
||||||
esac
|
*) clashcore=clash ;;
|
||||||
mv -f /tmp/clash*linux* $bindir/clash
|
esac
|
||||||
setconfig clashcore $clashcore
|
mv -f /tmp/clash*linux* $bindir/clash
|
||||||
echo -----------------------------------------------
|
setconfig clashcore $clashcore
|
||||||
}
|
}
|
||||||
|
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"
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user