Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easier Install Script (Linux) #3535

Open
Pastyguy opened this issue Dec 24, 2016 · 3 comments
Open

Easier Install Script (Linux) #3535

Pastyguy opened this issue Dec 24, 2016 · 3 comments

Comments

@Pastyguy
Copy link

Easier Install Script (Linux)

Version information:

go-ipfs version: 0.4.4-
Repo version: 4
System version: 386/linux
Golang version: go1.7

Enhancement

Install Process

Discription

I made an easier to use install script for linux (ubuntu 14.04 server), i think it will work on other platforms
so this please give it a try on other platforms to see if the code breaks.

how to use

Windows: On your desktop create a file called

install.sh

inside the file paste the code
save the file

install.sh
Save as type "All Files (.)
Save

Transfer the file to your Linux computers home folder

open terminal

$ cd ~
$ ls

you should get

install.sh

if not try to put the file in this directory.

now type

sudo bash install.sh

You will get this text

IPFS Installer Script : Enter 'x32' or 'x64'

enter x32 if your sys is 32bit or x64 for 64bit

x64

If all went well you should see

Installing the x64 vision of IPFS...
/IPFS Exists
--2016-12-24 03:32:43-- https://dist.ipfs.io/go-ipfs/v0.4.4/go-ipfs_v0.4.4_linux-amd64.tar.gz
Resolving dist.ipfs.io (dist.ipfs.io)... 2604:a880:1:20::1f9:9001, 2604:a880:0:1010::23:d001, 2604:a880:1:20::1d9:6001, ...
Connecting to dist.ipfs.io (dist.ipfs.io)|2604:a880:1:20::1f9:9001|:443... connected.

Wait for it to resolve and download
And it should install an you will be good.
if you having errors give me a comment here

thanks
-wisemonkey

#!/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

insatll.sh.txt

@hsanjuan
Copy link
Contributor

Hello,

thanks for your contribution.

Note that much of this functionality is already provided by ipfs-update.

@Pastyguy
Copy link
Author

If I may ask how do you use ipfs update.
Ie install for Linux 64bit?

@hsanjuan
Copy link
Contributor

Sure, you can either go get as shown here: https://github.com/ipfs/ipfs-update#install

or download the tar.gz I linked above, untar and place the binary in /usr/local/bin or simply run the install.sh script.

Then:

> ipfs-update --help
NAME:
   ipfs-update - Update ipfs.

USAGE:
   ipfs-update [global options] command [command options] [arguments...]

VERSION:
   0.1.0

COMMANDS:
     versions  Print out all available versions.
     version   Print out currently installed version.
     install   Install a version of ipfs.
     stash     stashes copy of currently installed ipfs binary
     revert    Revert to previously installed version of ipfs.
     fetch     Fetch a given version of ipfs. Default: latest.
     help, h   Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --verbose         Print verbose output.
   --distpath value  specify the distributions build to use
   --help, -h        show help
   --version, -v     print the version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants