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 PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH 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 # step 0: prepare
OS_ARCH=${1} OS_ARCH=$ARCHITECTURE
WORKSPACE=${2} WORKSPACE=${1}
passwd=${3} passwd=${2}
uid=${4} uid=${3}
server_address=${5} server_address=${4}
user_name=${6} user_name=${5}
test_or_not=${7} test_or_not=${6}
mkdir -p ${WORKSPACE} mkdir -p ${WORKSPACE}
cd ${WORKSPACE} cd ${WORKSPACE}