This commit is contained in:
Bob Mottram 2015-09-29 19:28:47 +01:00
parent 12e4ad17a9
commit 12b4b929ea
1 changed files with 9 additions and 6 deletions

View File

@ -10336,9 +10336,11 @@ function install_ipfs {
fi
fi
IPFS_PATH=/home/git/go/src/github.com/ipfs/go-ipfs/cmd
if ! grep -q 'GOPATH/bin' ~/.bashrc; then
echo 'export PATH="$GOPATH/bin:$PATH:";' >> ~/.bashrc
echo 'export PATH="$PATH:$GOPATH/src/github.com/ipfs/go-ipfs/cmd";' >> ~/.bashrc
echo -n 'export PATH="$PATH:' >> ~/.bashrc
echo "$IPFS_PATH\";" >> ~/.bashrc
fi
. ~/.bashrc
@ -10346,7 +10348,8 @@ function install_ipfs {
if ! grep -q "GOPATH=" /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
echo 'export PATH="$PATH:$GOPATH/src/github.com/ipfs/go-ipfs/cmd";' >> /home/$MY_USERNAME/.bashrc
echo 'export PATH="$PATH:' >> /home/$MY_USERNAME/.bashrc
echo "$IPFS_PATH\";" >> /home/$MY_USERNAME/.bashrc
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.bashrc
fi
@ -10356,13 +10359,13 @@ function install_ipfs {
fi
# initialise
su -c 'ipfs init -b 4096' - $MY_USERNAME
su -c "$IPFS_PATH/ipfs init -b 4096" - $MY_USERNAME
if [ ! -d /home/$MY_USERNAME/.ipfs ]; then
echo "IPFS could not be initialised for user $MY_USERNAME"
exit 7358
fi
IPFS_IDENTITY=$(ipfs refs local | tail -n 1 | tr '\n' ' ' | tr -d '[[:space:]]')
IPFS_IDENTITY=$($IPFS_PATH/ipfs refs local | tail -n 1 | tr '\n' ' ' | tr -d '[[:space:]]')
if [ ${#IPFS_IDENTITY} -lt 10 ]; then
echo 'IPFS identity shorter than expected'
echo "$IPFS_IDENTITY"
@ -10397,8 +10400,8 @@ function install_ipfs {
echo 'Type=simple' >> /etc/systemd/system/ipfs.service
echo 'User=git' >> /etc/systemd/system/ipfs.service
echo 'Group=git' >> /etc/systemd/system/ipfs.service
echo 'WorkingDirectory=/home/git/go/src/github.com/ipfs/go-ipfs/cmd' >> /etc/systemd/system/ipfs.service
echo 'ExecStart=/home/git/go/src/github.com/ipfs/go-ipfs/cmd/ipfs daemon --mount' >> /etc/systemd/system/ipfs.service
echo 'WorkingDirectory=/home/git' >> /etc/systemd/system/ipfs.service
echo "ExecStart=$IPFS_PATH/ipfs daemon --mount" >> /etc/systemd/system/ipfs.service
echo 'Restart=on-failure' >> /etc/systemd/system/ipfs.service
echo 'Environment="USER=git" "HOME=/home/git" "GOPATH=/home/git/go"' >> /etc/systemd/system/ipfs.service
echo '' >> /etc/systemd/system/ipfs.service