-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
32 lines (29 loc) · 1.1 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# Check ROOT & OpenWrt
if [ $(id -u) != "0" ]; then
echo "Error: You must be root to run this script, please use root user"
exit 1
fi
openwrt_release=$(cat /etc/openwrt_release)
if ! grep -q "OpenWrt" <<< "$openwrt_release"; then
echo "Your system is not supported!"
exit 1
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://service.miaoer.xyz/cattools/cattools.sh; then
echo "cattools installed successfully from the first URL."
elif 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 second URL."
else
echo "Failed to download cattools from both URLs."
exit 1
fi
chmod +x /usr/bin/cattools
fi
echo "cattools is installed successfully!"
echo "please type ‘cattools’ or ‘/usr/bin/cattools’ to run it."
}
install_cattools