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
 }
104
 }
105
 
105
 
106
 function restore_remote_ipfs {
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
 function remove_ipfs {
124
 function remove_ipfs {

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

421
 	fi
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
 function restore_ssh_keys {
424
 function restore_ssh_keys {
444
 	if [[ $RESTORE_APP != 'all' ]]; then
425
 	if [[ $RESTORE_APP != 'all' ]]; then
445
 		if [[ $RESTORE_APP != 'ssh' ]]; then
426
 		if [[ $RESTORE_APP != 'ssh' ]]; then
1127
 restore_procmail
1108
 restore_procmail
1128
 restore_spamassassin
1109
 restore_spamassassin
1129
 restore_admin_readme
1110
 restore_admin_readme
1130
-restore_ipfs
1131
 restore_ssh_keys
1111
 restore_ssh_keys
1132
 restore_user_config
1112
 restore_user_config
1133
 restore_user_monkeysphere
1113
 restore_user_monkeysphere
1136
 restore_certs
1116
 restore_certs
1137
 restore_personal_settings
1117
 restore_personal_settings
1138
 restore_mailing_list
1118
 restore_mailing_list
1119
+restore_email
1120
+
1139
 restore_xmpp
1121
 restore_xmpp
1140
 restore_gnusocial
1122
 restore_gnusocial
1141
 restore_hubzilla
1123
 restore_hubzilla
1148
 restore_cjdns
1130
 restore_cjdns
1149
 restore_voip
1131
 restore_voip
1150
 restore_tox
1132
 restore_tox
1151
-restore_email
1152
 restore_dlna
1133
 restore_dlna
1153
 
1134
 
1154
 echo $"*** Remote restore was successful ***"
1135
 echo $"*** Remote restore was successful ***"