Fix ipfs id

This commit is contained in:
Bob Mottram 2016-09-03 15:51:10 +01:00
parent 654ca16983
commit c23c431b8f
1 changed files with 5 additions and 1 deletions

View File

@ -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