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
update_cattools() { update_cattools() {
echo: "Please wait for the script to be updated."
local temp_file=$(mktemp) local temp_file=$(mktemp)
if curl --silent --connect-timeout 5 -o "$temp_file" https://raw.githubusercontent.com/miaoermua/cattools/main/cattools.sh; then 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." 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 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." echo "cattools update downloaded from the second URL."
else 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" rm -f "$temp_file"
return return
fi fi
mv "$temp_file" /usr/bin/cattools mv "$temp_file" /usr/bin/cattools
chmod +x /usr/bin/cattools chmod +x /usr/bin/cattools
echo "cattools updated successfully." echo "cattools updated successfully."
echo ""
} }
# Menu Function # Menu Function
@@ -41,7 +44,7 @@ menu() {
echo "" echo ""
echo "----------------------------------------------------------" echo "----------------------------------------------------------"
echo " CatTools " echo " CatTools "
echo " https://www.miaoer.xyz/posts/network/catwrt-bash-script " echo " https://github.com/miaoermua/cattools "
echo "----------------------------------------------------------" echo "----------------------------------------------------------"
echo "1. SetIP - 设置 IP" echo "1. SetIP - 设置 IP"
echo "2. network_wizard - 网络向导" echo "2. network_wizard - 网络向导"