Install ipfs for mesh clients

This commit is contained in:
Bob Mottram 2015-09-30 11:53:18 +01:00
parent 5dd057635b
commit 8dd34fb43c
1 changed files with 43 additions and 0 deletions

View File

@ -20,6 +20,48 @@ UPDATED="no"
ZERONET_DEFAULT_BLOG_TAGLINE="Blogging on the Mesh" ZERONET_DEFAULT_BLOG_TAGLINE="Blogging on the Mesh"
ZERONET_DEFAULT_FORUM_TAGLINE="A decentralized discussion group" ZERONET_DEFAULT_FORUM_TAGLINE="A decentralized discussion group"
function install_ipfs {
if [ ! -f /home/$MY_USERNAME/go/bin/ipfs ]; then
sudo apt-get -y install golang libpam0g-dev fuse
if ! grep -q "GOPATH/bin" /home/$MY_USERNAME/.bashrc; then
echo 'export GOPATH=/home/git/go' >> /home/$MY_USERNAME/.bashrc
echo 'export PATH="$GOPATH/bin:$PATH:";' >> /home/$MY_USERNAME/.bashrc
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.bashrc
. ~/.bashrc
fi
if [ ! -d /home/$MY_USERNAME/go ]; then
mkdir /home/$MY_USERNAME/go
fi
go get -u github.com/ipfs/go-ipfs/cmd/ipfs
if [ ! "$?" = "0" ]; then
exit 8242
fi
fi
if [ ! -d /home/$MY_USERNAME/.ipfs ]; then
ipfs init -b 4096
if [ ! -d /home/$MY_USERNAME/.ipfs ]; then
echo "IPFS could not be initialised"
exit 7358
fi
# directories to mount to
if [ ! -d /ipfs ]; then
sudo mkdir /ipfs
sudo mkdir /ipns
sudo chown $MY_USERNAME:$MY_USERNAME /ipfs
sudo chown $MY_USERNAME:$MY_USERNAME /ipns
fi
if [ -f /etc/fuse.conf ]; then
sudo chown $MY_USERNAME:$MY_USERNAME /etc/fuse.conf
fi
if [ -f /dev/fuse ]; then
sudo chown $MY_USERNAME:$MY_USERNAME /dev/fuse
fi
fi
}
function install_zeronet_blog { function install_zeronet_blog {
if [ ! -f /home/$MY_USERNAME/README ]; then if [ ! -f /home/$MY_USERNAME/README ]; then
touch /home/$MY_USERNAME/README touch /home/$MY_USERNAME/README
@ -269,6 +311,7 @@ if [[ $SERVER_INSTALLATION == "no" ]]; then
install_zeronet install_zeronet
install_zeronet_blog install_zeronet_blog
install_zeronet_forum install_zeronet_forum
install_ipfs
sudo batman start sudo batman start
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then
exit 2 exit 2