From e93f7eeb431587e4c53f716598219d59be322c3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=96=B5=E4=BA=8C?= <66155308+miaoermua@users.noreply.github.com> Date: Wed, 27 Dec 2023 17:40:24 +0800 Subject: [PATCH] Update cattools.sh --- cattools.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/cattools.sh b/cattools.sh index 0c70086..4cf18c7 100644 --- a/cattools.sh +++ b/cattools.sh @@ -31,6 +31,24 @@ else exit 1 fi +update(){ + if ! curl -fsSL https://service.miaoer.xyz/cattools/cattools.sh -o $(readlink -f "$0"); then + echo "无法连接更新站点" + + if ! curl -fsSL https://fastly.jsdelivr.net/gh/miaoermua/cattools@main/repo/mt798x/cattools.sh -o $(readlink -f "$0"); then + echo "无法连接更新仓库" + + if ! curl -fsSL https://raw.githubusercontent.com/miaoermua/service/main/cattools/cattools.sh -o $(readlink -f "$0"); then + echo "无法连接更新仓库" + echo "无法连接互联网,请联系作者." + return + fi + fi + fi + + exec $(readlink -f "$0") +} + setip(){ read -p "请输入 IP(默认为 $DEFAULT_IP): " input_ip if [ -z $input_ip ]; then @@ -146,6 +164,7 @@ bypass_gateway(){ exit } +update while :; do clear