From 79a26d1a38e0aea9c69c1ebf472c535664cb1f7f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 12 Aug 2016 09:27:30 +0100 Subject: [PATCH] Check that ipfs was installed --- src/freedombone-app-ipfs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/freedombone-app-ipfs b/src/freedombone-app-ipfs index 893bf5f6..f0f7599c 100755 --- a/src/freedombone-app-ipfs +++ b/src/freedombone-app-ipfs @@ -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