Check that ipfs was installed

This commit is contained in:
Bob Mottram 2016-08-12 09:27:30 +01:00
parent 35617f5e1e
commit 79a26d1a38
1 changed files with 6 additions and 2 deletions

View File

@ -215,8 +215,12 @@ function install_ipfs_js {
IPFS_PATH=/usr/local/bin
if [ ! -f $IPFS_PATH/jsipfs ]; then
exit 637292
fi
# initialise
su -c "$IPFS_PATH/ipfs init -b 4096" - $MY_USERNAME
su -c "$IPFS_PATH/jsipfs init -b 4096" - $MY_USERNAME
if [ ! -d /home/$MY_USERNAME/.ipfs ]; then
echo "IPFS could not be initialised for user $MY_USERNAME"
exit 7358
@ -261,7 +265,7 @@ function install_ipfs_js {
systemctl restart ${IPFS_DAEMON_NAME}
if [ -d /etc/avahi ]; then
su -c "echo $($IPFS_PATH/ipfs id | grep '\"ID\":' | awk -F '\"' '{print $4}') > /tmp/ipfsid" - $MY_USERNAME
su -c "echo $($IPFS_PATH/jsipfs id | grep '\"ID\":' | awk -F '\"' '{print $4}') > /tmp/ipfsid" - $MY_USERNAME
if [ ! -f /tmp/ipfsid ]; then
echo 'No IPFS identity was created'
exit 37895