@@ -523,63 +523,61 @@ Windows Registry Editor Version 5.00
523523
524524 echo " 导入(更新)sing-boxr 配置文件"
525525 cd " $PROGRAMFILES "
526- if [ -f " ./sing-box/sing-box.exe" ]; then
527- if [ -f " ./sing-box/config.json" ]; then
528- echo " 检测到 sing-boxr 配置文件,是否更新?(Y/n)"
529- while true ; do
530- read -n1 -r choice
531- case $choice in
532- [Yy])
533- echo
534- echo " 正在下载 sing-boxr 配置文件..."
535- curl -sS -o " $USERPROFILE /Downloads/config.json" -L https://ghfast.top/{.json 配置文件直链}
536- echo " 下载 sing-boxr 配置文件成功"
537-
538- echo " 正在结束 sing-boxr 相关进程..."
539- taskkill //f //t //im " sing-box*"
540- echo " 结束 sing-boxr 相关进程成功"
541-
542- echo " 正在更新 sing-boxr 配置文件..."
543- mv -f " $USERPROFILE /Downloads/config.json" ./sing-box
544- echo " 更新 sing-boxr 配置文件成功,是否启动服务?(Y/n)"
545- ask_run
546- break
547- ;;
548- [Nn])
549- break
550- ;;
551- * )
552- echo
553- echo " 无效选择,请重新输入!"
554- ;;
555- esac
556- done
557- else
558- echo " 未检测到 sing-boxr 配置文件,是否导入?(Y/n)"
559- while true ; do
560- read -n1 -r choice
561- case $choice in
562- [Yy])
563- echo
564- echo " 正在导入 sing-boxr 配置文件..."
565- curl -sS -o " $USERPROFILE /Downloads/config.json" -L https://ghfast.top/{.json 配置文件直链}
566- mv -f " $USERPROFILE /Downloads/config.json" ./sing-box
567- echo " 导入 sing-boxr 配置文件成功,是否启动服务?(Y/n)"
568- ask_run
569- break
570- ;;
571- [Nn])
572- break
573- ;;
574- * )
575- echo
576- echo " 无效选择,请重新输入!"
577- ;;
578- esac
579- done
580- fi
526+ if [[ -f " ./sing-box/sing-box.exe" && -f " ./sing-box/config.json" ]]; then
527+ echo " 检测到 sing-boxr 配置文件,是否更新?(Y/n)"
528+ while true ; do
529+ read -n1 -r choice
530+ case $choice in
531+ [Yy])
532+ echo
533+ echo " 正在下载 sing-boxr 配置文件..."
534+ curl -sS -o " $USERPROFILE /Downloads/config.json" -L https://ghfast.top/{.json 配置文件直链}
535+ echo " 下载 sing-boxr 配置文件成功"
536+
537+ echo " 正在结束 sing-boxr 相关进程..."
538+ taskkill //f //t //im " sing-box*"
539+ echo " 结束 sing-boxr 相关进程成功"
540+
541+ echo " 正在更新 sing-boxr 配置文件..."
542+ mv -f " $USERPROFILE /Downloads/config.json" ./sing-box
543+ echo " 更新 sing-boxr 配置文件成功,是否启动服务?(Y/n)"
544+ ask_run
545+ break
546+ ;;
547+ [Nn])
548+ break
549+ ;;
550+ * )
551+ echo
552+ echo " 无效选择,请重新输入!"
553+ ;;
554+ esac
555+ done
556+ elif [ ! -f " ./sing-box/config.json" ]; then
557+ echo " 未检测到 sing-boxr 配置文件,是否导入?(Y/n)"
558+ while true ; do
559+ read -n1 -r choice
560+ case $choice in
561+ [Yy])
562+ echo
563+ echo " 正在导入 sing-boxr 配置文件..."
564+ curl -sS -o " $USERPROFILE /Downloads/config.json" -L https://ghfast.top/{.json 配置文件直链}
565+ mv -f " $USERPROFILE /Downloads/config.json" ./sing-box
566+ echo " 导入 sing-boxr 配置文件成功,是否启动服务?(Y/n)"
567+ ask_run
568+ break
569+ ;;
570+ [Nn])
571+ break
572+ ;;
573+ * )
574+ echo
575+ echo " 无效选择,请重新输入!"
576+ ;;
577+ esac
578+ done
581579 else
582- read -n1 -r -p " 未检测到 sing-boxr 内核,请返回菜单安装内核 !按任意键返回菜单..."
580+ read -n1 -r -p " 未检测到 sing-boxr 内核,请先返回菜单安装内核 !按任意键返回菜单..."
583581 fi
584582 ;;
585583 3)
@@ -608,7 +606,7 @@ Windows Registry Editor Version 5.00
608606 ;;
609607 esac
610608 done
611-
609+
612610 ```
613611
614612- ② 另存为 .sh 文件,右击并选择“以管理员身份运行”
0 commit comments