From 587edb13fd0b664add5b3ab99e14d4f652334a54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=96=B5=E4=BA=8C?= <66155308+miaoermua@users.noreply.github.com> Date: Mon, 10 Jun 2024 13:49:57 +0800 Subject: [PATCH] Update cattools.sh --- cattools.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/cattools.sh b/cattools.sh index 3b5b73e..0be500d 100644 --- a/cattools.sh +++ b/cattools.sh @@ -19,6 +19,23 @@ if ! grep -q "OpenWrt" <<< "$openwrt_release"; then exit 1 fi +# install +install_cattools() { + local CATTOOLS_PATH="/usr/bin/cattools" + local CATTOOLS_URL="https://raw.githubusercontent.com/miaoermua/cattools/main/cattools.sh" + + if [ ! -f "$CATTOOLS_PATH" ]; then + echo "cattools 未安装,正在安装..." + curl -m 5 -s -o "$CATTOOLS_PATH" "$CATTOOLS_URL" + if [ $? -ne 0 ]; then + echo "cattools 下载失败,请检查网络连接。" + exit 1 + fi + chmod +x "$CATTOOLS_PATH" + echo "cattools 安装成功。" + fi +} + # HotUpdate check_for_updates() { local UPDATE_URLS=( @@ -259,6 +276,14 @@ use_repo(){ opkg update } +# init + +install_cattools + +check_for_updates + +# choice + while true; do show_menu read choice