34
cattools.sh
34
cattools.sh
@@ -5,9 +5,12 @@ RELEASE="/etc/catwrt_release"
|
|||||||
BACKUP_FILE="/etc/catwrt_opkg_list_installed"
|
BACKUP_FILE="/etc/catwrt_opkg_list_installed"
|
||||||
API_URL="https://api.miaoer.xyz/api/v2/snippets/catwrt/update"
|
API_URL="https://api.miaoer.xyz/api/v2/snippets/catwrt/update"
|
||||||
BASE_URL="https://mirror.ghproxy.com/https://raw.githubusercontent.com/miaoermua/cattools/main/repo"
|
BASE_URL="https://mirror.ghproxy.com/https://raw.githubusercontent.com/miaoermua/cattools/main/repo"
|
||||||
|
|
||||||
|
# sysupgrade env
|
||||||
AMD64_EFI_SYSUP="https://raw.githubusercontent.com/miaoermua/cattools/main/sysupgrade/amd64/sysup_efi"
|
AMD64_EFI_SYSUP="https://raw.githubusercontent.com/miaoermua/cattools/main/sysupgrade/amd64/sysup_efi"
|
||||||
AMD64_BIOS_SYSUP="https://raw.githubusercontent.com/miaoermua/cattools/main/sysupgrade/amd64/sysup_bios"
|
AMD64_BIOS_SYSUP="https://raw.githubusercontent.com/miaoermua/cattools/main/sysupgrade/amd64/sysup_bios"
|
||||||
MT7621_SYSUP="https://raw.githubusercontent.com/miaoermua/cattools/main/sysupgrade/mt7621/"
|
MT7621_SYSUP="https://raw.githubusercontent.com/miaoermua/cattools/main/sysupgrade/mt7621/"
|
||||||
|
MT798X_SYSUP="https://raw.githubusercontent.com/miaoermua/cattools/main/sysupgrade/mt798x/"
|
||||||
|
|
||||||
# Check ROOT & CatWrt/Lean's LEDE(QWRT)
|
# Check ROOT & CatWrt/Lean's LEDE(QWRT)
|
||||||
if [ $(id -u) != "0" ]; then
|
if [ $(id -u) != "0" ]; then
|
||||||
@@ -926,7 +929,8 @@ sysupgrade() {
|
|||||||
arch=$(cat /etc/catwrt_release | grep "^arch=" | cut -d'=' -f2)
|
arch=$(cat /etc/catwrt_release | grep "^arch=" | cut -d'=' -f2)
|
||||||
board_name=$(cat /tmp/sysinfo/board_name)
|
board_name=$(cat /tmp/sysinfo/board_name)
|
||||||
|
|
||||||
if [ "$arch" != "mt7621" ] && [ "$arch" != "amd64" ]; then
|
# 检查架构
|
||||||
|
if [ "$arch" != "mt7621" ] && [ "$arch" != "amd64" ] && [ "$arch" != "mt798x" ]; then
|
||||||
echo "[Error] 不支持的架构: $arch"
|
echo "[Error] 不支持的架构: $arch"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -947,9 +951,9 @@ sysupgrade() {
|
|||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
firmware_url="$mt7621_sysup$base_fw_url"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ "$arch" = "amd64" ]; then
|
if [ "$arch" = "amd64" ]; then
|
||||||
echo
|
echo
|
||||||
|
|
||||||
@@ -976,13 +980,28 @@ sysupgrade() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$arch" = "mt7621" ]; then
|
if [ "$arch" = "mt798x" ]; then
|
||||||
firmware_url="$MT7621_SYSUP$base_fw_url"
|
case "$board_name" in
|
||||||
elif [ "$arch" = "amd64" ]; then
|
*"redmi-router-ax6000")
|
||||||
firmware_url=$firmware_url
|
base_fw_url="sysup_redmi-router-ax6000"
|
||||||
|
;;
|
||||||
|
*"tl-xdr6088")
|
||||||
|
base_fw_url="sysup_tl-xdr6088"
|
||||||
|
;;
|
||||||
|
*"tl-xdr4288")
|
||||||
|
base_fw_url="sysup_tl-xdr4288"
|
||||||
|
;;
|
||||||
|
*"tl-xdr6086")
|
||||||
|
base_fw_url="sysup_tl-xdr6086"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "[Error] 该设备不支持通过此 Cattools 进行系统升级,请反馈给我们以支持!"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
firmware_url="$mt798x_sysup$base_fw_url"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ -f /etc/catwrt_opkg_list_installed ]; then
|
if [ -f /etc/catwrt_opkg_list_installed ]; then
|
||||||
rm /etc/catwrt_opkg_list_installed
|
rm /etc/catwrt_opkg_list_installed
|
||||||
fi
|
fi
|
||||||
@@ -994,7 +1013,6 @@ sysupgrade() {
|
|||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Warning ================================================================="
|
echo "Warning ================================================================="
|
||||||
|
|
||||||
echo "即将升级系统,存在不可恢复风险请输入 ([1] 确认/[2] 取消),15s 后将默认继续升级!"
|
echo "即将升级系统,存在不可恢复风险请输入 ([1] 确认/[2] 取消),15s 后将默认继续升级!"
|
||||||
echo "该功能通过 OpenWrt sysupgrade 升级系统,不保证 100% 升级成功,请三思!"
|
echo "该功能通过 OpenWrt sysupgrade 升级系统,不保证 100% 升级成功,请三思!"
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
7
sysupgrade/mt798x/sysup_redmi-router-ax6000
Normal file
7
sysupgrade/mt798x/sysup_redmi-router-ax6000
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
## Dangerous! this operation does not allow normal users to bypass cattools!
|
||||||
|
|
||||||
|
MT798X_SYSUP="https://github.com/miaoermua/CatWrt/releases/download/v23.8.mt798x/CatWrt.v23.8.mt798x-filogic-xiaomi_redmi-router-ax6000-squashfs-sysupgrade.bin"
|
||||||
|
|
||||||
|
sysupgrade -v $MT798X_SYSUP
|
||||||
8
sysupgrade/mt798x/sysup_redmi-router-ax6000_ghproxy
Normal file
8
sysupgrade/mt798x/sysup_redmi-router-ax6000_ghproxy
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
## Dangerous! this operation does not allow normal users to bypass cattools!
|
||||||
|
|
||||||
|
MT798X_SYSUP="https://github.com/miaoermua/CatWrt/releases/download/v23.8.mt798x/CatWrt.v23.8.mt798x-filogic-xiaomi_redmi-router-ax6000-squashfs-sysupgrade.bin"
|
||||||
|
GHPROXY="https://mirror.ghproxy.com/"
|
||||||
|
|
||||||
|
sysupgrade -v $GHPROXY$MT798X_SYSUP
|
||||||
7
sysupgrade/mt798x/sysup_tl-xdr4288
Normal file
7
sysupgrade/mt798x/sysup_tl-xdr4288
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
## Dangerous! this operation does not allow normal users to bypass cattools!
|
||||||
|
|
||||||
|
MT798X_SYSUP="https://github.com/miaoermua/CatWrt/releases/download/v23.8.mt798x/CatWrt.v23.8.mt798x-filogic-tplink_tl-xdr4288-squashfs-sysupgrade.bin"
|
||||||
|
|
||||||
|
sysupgrade -v $MT798X_SYSUP
|
||||||
8
sysupgrade/mt798x/sysup_tl-xdr4288_ghproxy
Normal file
8
sysupgrade/mt798x/sysup_tl-xdr4288_ghproxy
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
## Dangerous! this operation does not allow normal users to bypass cattools!
|
||||||
|
|
||||||
|
MT798X_SYSUP="https://github.com/miaoermua/CatWrt/releases/download/v23.8.mt798x/CatWrt.v23.8.mt798x-filogic-tplink_tl-xdr4288-squashfs-sysupgrade.bin"
|
||||||
|
GHPROXY="https://mirror.ghproxy.com/"
|
||||||
|
|
||||||
|
sysupgrade -v $GHPROXY$MT798X_SYSUP
|
||||||
7
sysupgrade/mt798x/sysup_tl-xdr6086
Normal file
7
sysupgrade/mt798x/sysup_tl-xdr6086
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
## Dangerous! this operation does not allow normal users to bypass cattools!
|
||||||
|
|
||||||
|
MT798X_SYSUP="https://github.com/miaoermua/CatWrt/releases/download/v23.8.mt798x/CatWrt.v23.8.mt798x-filogic-tplink_tl-xdr6086-squashfs-sysupgrade.bin"
|
||||||
|
|
||||||
|
sysupgrade -v $MT798X_SYSUP
|
||||||
8
sysupgrade/mt798x/sysup_tl-xdr6086_ghproxy
Normal file
8
sysupgrade/mt798x/sysup_tl-xdr6086_ghproxy
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
## Dangerous! this operation does not allow normal users to bypass cattools!
|
||||||
|
|
||||||
|
MT798X_SYSUP="https://github.com/miaoermua/CatWrt/releases/download/v23.8.mt798x/CatWrt.v23.8.mt798x-filogic-tplink_tl-xdr6086-squashfs-sysupgrade.bin"
|
||||||
|
GHPROXY="https://mirror.ghproxy.com/"
|
||||||
|
|
||||||
|
sysupgrade -v $GHPROXY$MT798X_SYSUP
|
||||||
7
sysupgrade/mt798x/sysup_tl-xdr6088
Normal file
7
sysupgrade/mt798x/sysup_tl-xdr6088
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
## Dangerous! this operation does not allow normal users to bypass cattools!
|
||||||
|
|
||||||
|
MT798X_SYSUP="https://github.com/miaoermua/CatWrt/releases/download/v23.8.mt798x/CatWrt.v23.8.mt798x-filogic-tplink_tl-xdr6088-squashfs-sysupgrade.bin"
|
||||||
|
|
||||||
|
sysupgrade -v $MT798X_SYSUP
|
||||||
8
sysupgrade/mt798x/sysup_tl-xdr6088_ghproxy
Normal file
8
sysupgrade/mt798x/sysup_tl-xdr6088_ghproxy
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
## Dangerous! this operation does not allow normal users to bypass cattools!
|
||||||
|
|
||||||
|
MT798X_SYSUP="https://github.com/miaoermua/CatWrt/releases/download/v23.8.mt798x/CatWrt.v23.8.mt798x-filogic-tplink_tl-xdr6088-squashfs-sysupgrade.bin"
|
||||||
|
GHPROXY="https://mirror.ghproxy.com/"
|
||||||
|
|
||||||
|
sysupgrade -v $GHPROXY$MT798X_SYSUP
|
||||||
Reference in New Issue
Block a user