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