Update cattools.sh
This commit is contained in:
17
cattools.sh
17
cattools.sh
@@ -19,22 +19,6 @@ if ! grep -q "OpenWrt" <<< "$openwrt_release"; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# installed
|
|
||||||
install_cattools() {
|
|
||||||
if [ ! -f /usr/bin/cattools ]; then
|
|
||||||
echo "cattools not found, installing..."
|
|
||||||
if curl --silent --connect-timeout 5 -o /usr/bin/cattools https://raw.githubusercontent.com/miaoermua/cattools/main/cattools.sh; then
|
|
||||||
echo "cattools installed successfully from the first URL."
|
|
||||||
elif curl --silent --connect-timeout 5 -o /usr/bin/cattools https://fastly.jsdelivr.net/gh/miaoermua/cattools@main/cattools.sh; then
|
|
||||||
echo "cattools installed successfully from the second URL."
|
|
||||||
else
|
|
||||||
echo "Failed to download cattools from both URLs."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
chmod +x /usr/bin/cattools
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Update
|
# Update
|
||||||
update_cattools() {
|
update_cattools() {
|
||||||
local temp_file=$(mktemp)
|
local temp_file=$(mktemp)
|
||||||
@@ -52,7 +36,6 @@ update_cattools() {
|
|||||||
echo "cattools updated successfully."
|
echo "cattools updated successfully."
|
||||||
}
|
}
|
||||||
|
|
||||||
install_cattools
|
|
||||||
update_cattools
|
update_cattools
|
||||||
|
|
||||||
# Menu Function
|
# Menu Function
|
||||||
|
|||||||
Reference in New Issue
Block a user