From c23c431b8f29a1b9ef43dc3f76cecdeaf2a652c9 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 3 Sep 2016 15:51:10 +0100 Subject: [PATCH] Fix ipfs id --- src/freedombone-image-mesh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/freedombone-image-mesh b/src/freedombone-image-mesh index cb26d077..21c04cd9 100755 --- a/src/freedombone-image-mesh +++ b/src/freedombone-image-mesh @@ -730,6 +730,10 @@ function setup_ipfs { rm -rf /home/$MY_USERNAME/.ipfs fi + if [ -f /home/$MY_USERNAME/.ipfs-id ]; then + rm -f /home/$MY_USERNAME/.ipfs-id + fi + su -c "$IPFS_COMMAND init -b $IPFS_KEY_LENGTH" - $MY_USERNAME if [ ! -d /home/$MY_USERNAME/.ipfs ]; then echo "IPFS could not be initialised for user $MY_USERNAME" >> $INSTALL_LOG @@ -737,7 +741,7 @@ function setup_ipfs { fi MY_IPFS_ID=/home/$MY_USERNAME/.ipfs-id - su -c "echo $($IPFS_COMMAND id | grep '\"ID\":' | awk -F '\"' '{print $4}') > $MY_IPFS_ID" - $MY_USERNAME + su -c "echo \$($IPFS_COMMAND id | grep '\"ID\":' | awk -F '\"' '{print \$4}') > $MY_IPFS_ID" - $MY_USERNAME if [ ! -f $MY_IPFS_ID ]; then echo 'No IPFS identity was created' >> $INSTALL_LOG return