Browse Source

Move remote ipfs restore to app script

Bob Mottram 8 years ago
parent
commit
5f34143c8b
2 changed files with 17 additions and 22 deletions
  1. 15
    1
      src/freedombone-app-ipfs
  2. 2
    21
      src/freedombone-restore-remote

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

@@ -104,7 +104,21 @@ function backup_remote_ipfs {
104 104
 }
105 105
 
106 106
 function restore_remote_ipfs {
107
-	echo -n ''
107
+	if [ -d $SERVER_DIRECTORY/backup/ipfs ]; then
108
+		echo $"Restoring IPFS"
109
+		temp_restore_dir=/root/tempipfs
110
+		function_check restore_directory_from_friend
111
+		restore_directory_from_friend $temp_restore_dir ipfs
112
+		cp -rf $temp_restore_dir/home/$ADMIN_USERNAME/.ipfs/* /home/$ADMIN_USERNAME/.ipfs
113
+		if [ ! "$?" = "0" ]; then
114
+			function_check set_user_permissions
115
+			set_user_permissions
116
+			rm -rf $temp_restore_dir
117
+			exit 276357
118
+		fi
119
+		rm -rf $temp_restore_dir
120
+		echo $"Restore of IPFS complete"
121
+	fi
108 122
 }
109 123
 
110 124
 function remove_ipfs {

+ 2
- 21
src/freedombone-restore-remote View File

@@ -421,25 +421,6 @@ function restore_admin_readme {
421 421
 	fi
422 422
 }
423 423
 
424
-function restore_ipfs {
425
-	if [[ $RESTORE_APP != 'all' ]]; then
426
-		if [[ $RESTORE_APP != 'ipfs' ]]; then
427
-			return
428
-		fi
429
-	fi
430
-	if [ -d $SERVER_DIRECTORY/backup/ipfs ]; then
431
-		echo $"Restoring IPFS"
432
-		temp_restore_dir=/root/tempipfs
433
-		restore_directory_from_friend $temp_restore_dir ipfs
434
-		cp -rf $temp_restore_dir/home/$ADMIN_USERNAME/.ipfs/* /home/$ADMIN_USERNAME/.ipfs
435
-		if [ ! "$?" = "0" ]; then
436
-			rm -rf $temp_restore_dir
437
-			exit 276
438
-		fi
439
-		rm -rf $temp_restore_dir
440
-	fi
441
-}
442
-
443 424
 function restore_ssh_keys {
444 425
 	if [[ $RESTORE_APP != 'all' ]]; then
445 426
 		if [[ $RESTORE_APP != 'ssh' ]]; then
@@ -1127,7 +1108,6 @@ restore_gpg
1127 1108
 restore_procmail
1128 1109
 restore_spamassassin
1129 1110
 restore_admin_readme
1130
-restore_ipfs
1131 1111
 restore_ssh_keys
1132 1112
 restore_user_config
1133 1113
 restore_user_monkeysphere
@@ -1136,6 +1116,8 @@ restore_user_local
1136 1116
 restore_certs
1137 1117
 restore_personal_settings
1138 1118
 restore_mailing_list
1119
+restore_email
1120
+
1139 1121
 restore_xmpp
1140 1122
 restore_gnusocial
1141 1123
 restore_hubzilla
@@ -1148,7 +1130,6 @@ restore_blog
1148 1130
 restore_cjdns
1149 1131
 restore_voip
1150 1132
 restore_tox
1151
-restore_email
1152 1133
 restore_dlna
1153 1134
 
1154 1135
 echo $"*** Remote restore was successful ***"