From 12b4b929ea07d79680b5734de599a0df031febb5 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 29 Sep 2015 19:28:47 +0100 Subject: [PATCH] Paths --- src/freedombone | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/freedombone b/src/freedombone index 4b0ba91a..90e77017 100755 --- a/src/freedombone +++ b/src/freedombone @@ -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