Browse Source

Local backup for ipfs

Bob Mottram 9 years ago
parent
commit
a17c56f243
No account linked to committer's email
1 changed files with 15 additions and 2 deletions
  1. 15
    2
      src/freedombone-app-ipfs

+ 15
- 2
src/freedombone-app-ipfs View File

47
 }
47
 }
48
 
48
 
49
 function backup_local_ipfs {
49
 function backup_local_ipfs {
50
-    echo ''
50
+	if ! grep -q "Admin user" $COMPLETION_FILE; then
51
+		return
52
+	fi
53
+	ADMIN_USERNAME=$(cat $COMPLETION_FILE | grep "Admin user" | awk -F ':' '{print $2}')
54
+	source_directory=/home/$ADMIN_USERNAME/.ipfs
55
+	if [ -d $source_directory ]; then
56
+		dest_directory=ipfs
57
+		echo $"Backing up $source_directory to $dest_directory"
58
+
59
+		function_check backup_directory_to_usb
60
+		backup_directory_to_usb $source_directory $dest_directory
61
+
62
+		echo $"Backup to $dest_directory complete"
63
+	fi
51
 }
64
 }
52
 
65
 
53
 function backup_remote_ipfs {
66
 function backup_remote_ipfs {
54
-    echo ''
67
+	echo -n ''
55
 }
68
 }
56
 
69
 
57
 function remove_ipfs {
70
 function remove_ipfs {