Add ipfs install requirement fresh Ubuntu 20

This commit is contained in:
poka 2020-05-15 21:34:41 +02:00
parent 05bc86cc99
commit 2a61947521
1 changed files with 7 additions and 1 deletions

View File

@ -5,6 +5,9 @@ MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
# Ask user password on start
sudo true
# CHECK if daemon is already running
[[ $(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) ]] \
&& echo "ipfs daemon already running. EVERYTHING OK!" \
@ -19,6 +22,10 @@ if [ "$EUID" -eq 0 ]
else echo -e "${c_yellow}OK $USER, let's go!$c_";
fi
# Check requierments
sudo apt update
sudo apt install curl net-tools -y
[[ -d ~/.ipfs ]] && echo "IPFS install exist, please remove backup before execute this script" && exit 1
echo -e "${c_yellow}Onboarding IPFS...$c_"
@ -28,7 +35,6 @@ MACHINE_TYPE=`uname -m`
[ ${MACHINE_TYPE:0:3} == 'arm' ] && curl -s https://dist.ipfs.io/ipfs-update/v1.5.2/ipfs-update_v1.5.2_linux-arm.tar.gz -o $MY_PATH/ipfs-update.tar.gz || err+="Download ipfs-update"
[ ! -f $MY_PATH/ipfs-update.tar.gz ] && echo "Your $MACHINE_TYPE is not supported yet... Please add an issue." && exit 1
echo "INSTALL ipfs-update"
sudo tar -xvzf $MY_PATH/ipfs-update.tar.gz -C /usr/src/ || err+="Untar ipfs-update"
rm $MY_PATH/ipfs-update.tar.gz