Update serv00.sh

This commit is contained in:
甬哥侃侃侃ygkkk
2025-02-28 23:25:14 +08:00
committed by GitHub
parent 088011a7a9
commit 3ffffb8a9b
+33 -10
View File
@@ -1329,6 +1329,26 @@ if [[ -e $WORKDIR/config.json ]]; then
fi
}
nochinawarp(){
if [[ -e $WORKDIR/config.json ]]; then
gosite=$(jq -r '.route.rules[].rule_set[]?' $WORKDIR/config.json)
[[ "$gosite" == *"notcn"* ]] && echo 已开启非中国全局WARP代理 || echo 未开启非中国全局WARP代理
yellow "1、开启非中国全局WARP代理 (访问国外网站都用WARP的IP)"
yellow "2、关闭非中国全局WARP代理 (恢复默认)"
yellow "3、返回上层"
reading "【请选择 1 或者 2】: " gowarp
if [[ "$gowarp" == 1 ]]; then
jq -r '(.route.rules[] | select(.rule_set != null) | .rule_set[]) |= sub("cnn"; "notcn")' "$WORKDIR/config.json" > "$WORKDIR/temp.json" && mv "$WORKDIR/temp.json" "$WORKDIR/config.json"
elif [[ "$gowarp" == 2 ]]; then
jq -r '(.route.rules[] | select(.rule_set != null) | .rule_set[]) |= sub("notcn"; "cnn")' "$WORKDIR/config.json" > "$WORKDIR/temp.json" && mv "$WORKDIR/temp.json" "$WORKDIR/config.json"
else
sb
fi
else
red "未安装脚本,请选择1进行安装" && exit
fi
}
resservsb(){
if [[ -e $WORKDIR/config.json ]]; then
yellow "重启中……请稍后……"
@@ -1367,13 +1387,15 @@ menu() {
echo "------------------------------------------------------------"
green "4. 更新脚本"
echo "------------------------------------------------------------"
green "5. 查看各节点分享/sing-box与clash订阅链接/反代IP/ProxyIP"
green "5. 开启非中国全局WARP代理"
echo "------------------------------------------------------------"
green "6. 查看sing-box与clash配置文件"
green "6. 查看各节点分享/sing-box与clash订阅链接/反代IP/ProxyIP"
echo "------------------------------------------------------------"
yellow "7. 重置并随机生成新端口 (脚本安装前后都可执行)"
green "7. 查看sing-box与clash配置文件"
echo "------------------------------------------------------------"
yellow "8. 清理所有服务进程与文件 (系统初始化)"
yellow "8. 重置并随机生成新端口 (脚本安装前后都可执行)"
echo "------------------------------------------------------------"
yellow "9. 清理所有服务进程与文件 (系统初始化)"
echo "------------------------------------------------------------"
red "0. 退出脚本"
echo "============================================================"
@@ -1471,19 +1493,20 @@ yellow "未安装 Serv00-sb-yg 脚本!请选择 1 安装"
fi
#curl -sSL https://raw.githubusercontent.com/yonggekkk/sing-box-yg/main/serv00.sh -o serv00.sh && chmod +x serv00.sh
echo -e "========================================================="
reading "请输入选择【0-8】: " choice
reading "请输入选择【0-9】: " choice
echo
case "${choice}" in
1) install_singbox ;;
2) uninstall_singbox ;;
3) resservsb ;;
4) fastrun && green "脚本已更新成功" && sleep 2 && sb ;;
5) showlist ;;
6) showsbclash ;;
7) resallport ;;
8) kill_all_tasks ;;
5) nochinawarp ;;
6) showlist ;;
7) showsbclash ;;
8) resallport ;;
9) kill_all_tasks ;;
0) exit 0 ;;
*) red "无效的选项,请输入 0 到 8" ;;
*) red "无效的选项,请输入 0 到 9" ;;
esac
}
menu