diff --git a/src/freedombone-app-ipfs b/src/freedombone-app-ipfs index 368a9f83..c95c52be 100755 --- a/src/freedombone-app-ipfs +++ b/src/freedombone-app-ipfs @@ -47,11 +47,24 @@ function upgrade_ipfs { } function backup_local_ipfs { - echo '' + if ! grep -q "Admin user" $COMPLETION_FILE; then + return + fi + ADMIN_USERNAME=$(cat $COMPLETION_FILE | grep "Admin user" | awk -F ':' '{print $2}') + source_directory=/home/$ADMIN_USERNAME/.ipfs + if [ -d $source_directory ]; then + dest_directory=ipfs + echo $"Backing up $source_directory to $dest_directory" + + function_check backup_directory_to_usb + backup_directory_to_usb $source_directory $dest_directory + + echo $"Backup to $dest_directory complete" + fi } function backup_remote_ipfs { - echo '' + echo -n '' } function remove_ipfs {