Update cattools.sh

This commit is contained in:
喵二
2024-07-01 16:22:06 +08:00
committed by GitHub
parent 0c2e6648eb
commit 5a483279f4

View File

@@ -21,19 +21,22 @@ fi
# Update
update_cattools() {
echo: "Please wait for the script to be updated."
local temp_file=$(mktemp)
if curl --silent --connect-timeout 5 -o "$temp_file" https://raw.githubusercontent.com/miaoermua/cattools/main/cattools.sh; then
echo "cattools update downloaded from the first URL."
elif curl --silent --connect-timeout 5 -o "$temp_file" https://fastly.jsdelivr.net/gh/miaoermua/cattools@main/cattools.sh; then
echo "cattools update downloaded from the second URL."
else
echo "Failed to download updates for cattools from both URLs. Continuing with the existing version."
echo "Unable to download the latest version, continue to use the current offline version."
echo ""
rm -f "$temp_file"
return
fi
mv "$temp_file" /usr/bin/cattools
chmod +x /usr/bin/cattools
echo "cattools updated successfully."
echo ""
}
# Menu Function
@@ -41,7 +44,7 @@ menu() {
echo ""
echo "----------------------------------------------------------"
echo " CatTools "
echo " https://www.miaoer.xyz/posts/network/catwrt-bash-script "
echo " https://github.com/miaoermua/cattools "
echo "----------------------------------------------------------"
echo "1. SetIP - 设置 IP"
echo "2. network_wizard - 网络向导"