recognize architecture

main
AhFei 2023-09-08 20:31:12 +08:00
parent 6d65045ebe
commit 2bf749b955
1 changed files with 23 additions and 7 deletions

View File

@ -5,14 +5,30 @@ set -ex
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
apt-get install -y curl wget unzip
# get_architecture
arch=$(uname -m)
# 设置 ARCHITECTURE 变量
if [[ $arch == "aarch64" ]]; then
ARCHITECTURE="arm64"
elif [[ $arch == "x86_64" ]]; then
ARCHITECTURE="x86_64"
else
ARCHITECTURE="unknown"
fi
# step 0: prepare
OS_ARCH=${1}
WORKSPACE=${2}
passwd=${3}
uid=${4}
server_address=${5}
user_name=${6}
test_or_not=${7}
OS_ARCH=$ARCHITECTURE
WORKSPACE=${1}
passwd=${2}
uid=${3}
server_address=${4}
user_name=${5}
test_or_not=${6}
mkdir -p ${WORKSPACE}
cd ${WORKSPACE}