Update cattools.sh
This commit is contained in:
19
cattools.sh
19
cattools.sh
@@ -8,7 +8,7 @@
|
||||
###
|
||||
|
||||
default_ip="192.168.1.4"
|
||||
release="catwrt_release"
|
||||
release="/etc/catwrt_release"
|
||||
amd64_repo="https://fastly.jsdelivr.net/gh/miaoermua/cattools@main/repo/amd64/distfeeds.conf"
|
||||
mt798x_repo="https://fastly.jsdelivr.net/gh/miaoermua/cattools@main/repo/mt798x/distfeeds.conf"
|
||||
amd64_efi_boot_sysup="https://github.com/miaoermua/CatWrt/releases/download/v23.8/CatWrt.v23.8.x86_64-squashfs-combined-efi.img.gz"
|
||||
@@ -77,13 +77,20 @@ use_repo(){
|
||||
|
||||
arch=$(uname -m)
|
||||
|
||||
if [ "$arch" = "x86_64" ]; then
|
||||
# Check ARCH release
|
||||
model=$(grep "Model:" $release | cut -d ' ' -f2)
|
||||
|
||||
if [[ $model =~ "mt798x" ]]; then
|
||||
# mt798x
|
||||
curl -o /etc/opkg/distfeeds.conf $mt798x_repo
|
||||
|
||||
elif [ "$arch" = "x86_64" ]; then
|
||||
# amd64
|
||||
curl -o /etc/opkg/distfeeds.conf $amd64_repo
|
||||
rm -f /var/lock/opkg.lock
|
||||
opkg update
|
||||
echo "UPDATE!"
|
||||
|
||||
else
|
||||
echo "非 x86_64 架构,跳过"
|
||||
echo "不支持的机型: $model"
|
||||
return
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user