diff --git a/cattools.sh b/cattools.sh index 1c82a95..3ced007 100644 --- a/cattools.sh +++ b/cattools.sh @@ -30,6 +30,23 @@ else exit 1 fi +update + +update(){ + if ! curl -fsSL https://service.miaoer.xyz/cattools/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 + + exec $(readlink -f "$0") +} + setip(){ read -p "请输入 IP(默认为 $default_ip): " input_ip if [ -z $input_ip ]; then