This commit is contained in:
陆柯 2021-11-05 17:15:27 +08:00
parent 2f945bea6c
commit fed07bf3f8
2 changed files with 9 additions and 6 deletions

View File

@ -10,8 +10,10 @@ else
NewUser=adot NewUser=adot
fi fi
echo "<<< Installing basic tools"
apt update apt update
apt install -y emacs git curl screen sudo automake apt install -y emacs git curl screen sudo automake
echo
echo "<<< Making dir /faronear" echo "<<< Making dir /faronear"
if [ ! -d "/faronear" ] if [ ! -d "/faronear" ]

View File

@ -1,17 +1,18 @@
#!/bin/bash #!/bin/bash
echo "Usage: setup.sh [nodeVersion]" echo "Usage: setup.sh [nodeVersion]"
echo "Example: setup.sh 14"
defaultVersion=16
if [ v$1 != v ] if [ v$1 != v ]
then then
nodeVersion=$1 nodeVersion=$1
else else
read -p "Enter node version (leave blank for default 14; 'nvm' for nvm) >> " nodeVersion read -p "Enter nodejs version (leave blank for default 16; 'nvm' for nvm) >> " nodeVersion
if [ ! $nodeVersion ] if [ ! $nodeVersion ]
then then
echo Use default node version 14 nodeVersion=$defaultVersion
nodeVersion=14 echo Use default node version $nodeVersion
fi fi
fi fi
@ -23,8 +24,8 @@ else
echo "######## Installing C++ build tools for Linux ########" echo "######## Installing C++ build tools for Linux ########"
sudo apt install curl gcc g++ make -y sudo apt install curl gcc g++ make -y
echo "######## Installing node v$nodeVersion ########" echo "######## Installing nodejs v$nodeVersion ########"
echo From https://deb.nodesource.com/setup_$nodeVersion.x echo From https://deb.nodesource.com/setup_$nodeVersion.x
curl -sL https://deb.nodesource.com/setup_$nodeVersion.x | sudo bash - && sudo apt install nodejs -y curl -sL https://deb.nodesource.com/setup_$nodeVersion.x | sudo bash - && sudo apt install nodejs -y
echo "######## node v$nodeVersion installed completely! ##################" echo "######## nodejs v$nodeVersion installed completely! ##################"
fi fi