#!/bin/bash URLx64="https://dist.ipfs.io/go-ipfs/v0.4.4/go-ipfs_v0.4.4_linux-amd64.tar.gz" URLx32="https://dist.ipfs.io/go-ipfs/v0.4.4/go-ipfs_v0.4.4_linux-386.tar.gz" BIT32="x32" BIT64="x64" IPFSHOMEDIR="home" IPFSWEBDIR="www" echo "IPFS Installer Script : Enter 'x32' or 'x64'" read SystemArchitecture if((( "$SystemArchitecture" != "$BIT32" ) && ("$SystemArchitecture" != "$BIT64") )); then echo "Error thats not correct try eather 'x32' or 'x64'" exit else echo "Installing the $SystemArchitecture vision of IPFS..." fi cd / || "$ERRORMESSAGE" if [ -d /ipfs ]; then echo "/IPFS Exists" sudo rm -r /ipfs || exit sudo mkdir /ipfs || exit else echo "/IPFS Does Not Exist, Creating One Now.." sudo mkdir /ipfs || exit fi sudo chown "$USER":"$USER" /ipfs || exit sudo chmod 755 ipfs || exit cd /ipfs || exit if [ "$SystemArchitecture" = "x64" ]; then wget $URLx64 || exit fi if [ "$SystemArchitecture" = "x32" ]; then wget $URLx32 || exit fi tar xvfz go-ipfs_* || unzip go-ipfs_* mv go-ipfs/* /ipfs/ || exit rm go-ipfs_* || exit rm -r go-ipfs #cleanup the junk files sudo rm build-log sudo rm LICENSE sudo bash install.sh || exit sudo mkdir /ipfs/"$IPFSHOMEDIR" sudo chown "$USER":"$USER" /ipfs/"$IPFSHOMEDIR" sudo chmod 755 /ipfs/"$IPFSHOMEDIR" sudo mkdir /ipfs/"$IPFSHOMEDIR"/"$IPFSWEBDIR" sudo chown "$USER":"$USER" /ipfs/"$IPFSHOMEDIR"/"$IPFSWEBDIR" sudo chmod 755 /ipfs/"$IPFSHOMEDIR"/"$IPFSWEBDIR" ipfs version || exit echo "SUCCESFULLY INSTALLED IPFS!" ipfs init || ipfs daemon || exit