Update cattools.sh

This commit is contained in:
喵二
2024-06-10 14:06:25 +08:00
committed by GitHub
parent c6347c0459
commit 35bb8ef2e9

View File

@@ -41,11 +41,10 @@ install_cattools() {
chmod +x "$CATTOOLS_PATH"
echo "cattools 安装成功。"
echo ""
fi
}
# HotUpdate
# Hotupdate
check_for_updates() {
local UPDATE_URLS=(
"https://raw.githubusercontent.com/miaoermua/cattools/main/cattools.sh"
@@ -57,19 +56,23 @@ check_for_updates() {
for URL in "${UPDATE_URLS[@]}"; do
if curl -m 5 -s -o "$TEMP_FILE" "$URL"; then
if [ -s "$TEMP_FILE" ]; then
echo "更新已找到,替换当前脚本..."
echo "更新已找到,替换当前脚本..."
mv "$TEMP_FILE" "$0"
chmod +x "$0"
exec "$0" "$@"
fi
fi
done
rm -f "$TEMP_FILE"
echo "没有找到更新,继续运行当前脚本..."
echo ""
}
check_for_updates
install_cattools
# Menu Function
show_menu() {
echo "----------------------------------------------------------"
@@ -286,10 +289,6 @@ use_repo(){
opkg update
}
install_cattools
check_for_updates
while true; do
show_menu
read choice