use 'dpkg --print-architecture' to replace uname -m

This commit is contained in:
Luk Lu
2023-03-07 08:41:13 +08:00
parent 6e950b54cd
commit 809e0ba4be
3 changed files with 52 additions and 37 deletions

View File

@@ -10,12 +10,18 @@ then
DEBIAN_VERSION=11
fi
echo "=== Enter architecture [amd64, i386, arm64, armhf] or [leave blank] for amd64"
read -p ">>> " DEBIAN_ARCH
if [ -z "${DEBIAN_ARCH}" ]
then
DEBIAN_ARCH=amd64
fi
# 用 dpkg --print-architecture 更直接
ARCH=`dpkg --print-architecture`
# if [[ "$(uname -m)" = "aarch64" ]];
# then
# ARCH=arm64
# elif [[ "$(uname -m)" = "armv7l" ]];
# then
# ARCH=arm
# elif [[ "$(uname -m)" = "x86_64" ]];
# then
# ARCH=amd64
# fi
echo "=== Enter presets to download from [cdn, aws, china] or [leave blank] for cdn"
read -p ">>> " PRESET
@@ -26,7 +32,7 @@ fi
sudo curl -fLO https://raw.githubusercontent.com/bohanyang/debi/master/debi.sh
sudo chmod a+rx debi.sh
sudo ./debi.sh --version $DEBIAN_VERSION --architecture $DEBIAN_ARCH --user root --$PRESET # --architecture 可参略,默认为 amd64--password 可省略,则脚本启动后会问你要密码
sudo ./debi.sh --version $DEBIAN_VERSION --architecture $ARCH --user root --$PRESET # --architecture 可参略或者[amd64默认, i386, arm64, armhf]--password 可省略,则脚本启动后会问你要密码
echo "=== Shutdown now, wait for about 30 minutes (the project's github says 30 seconds), then try to ssh"
sudo shutdown -r now