Move remote ipfs restore to app script

This commit is contained in:
Bob Mottram 2016-07-10 13:05:23 +01:00
parent d540a4b1cb
commit 5f34143c8b
2 changed files with 17 additions and 22 deletions

View File

@ -104,7 +104,21 @@ function backup_remote_ipfs {
}
function restore_remote_ipfs {
echo -n ''
if [ -d $SERVER_DIRECTORY/backup/ipfs ]; then
echo $"Restoring IPFS"
temp_restore_dir=/root/tempipfs
function_check restore_directory_from_friend
restore_directory_from_friend $temp_restore_dir ipfs
cp -rf $temp_restore_dir/home/$ADMIN_USERNAME/.ipfs/* /home/$ADMIN_USERNAME/.ipfs
if [ ! "$?" = "0" ]; then
function_check set_user_permissions
set_user_permissions
rm -rf $temp_restore_dir
exit 276357
fi
rm -rf $temp_restore_dir
echo $"Restore of IPFS complete"
fi
}
function remove_ipfs {

View File

@ -421,25 +421,6 @@ function restore_admin_readme {
fi
}
function restore_ipfs {
if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'ipfs' ]]; then
return
fi
fi
if [ -d $SERVER_DIRECTORY/backup/ipfs ]; then
echo $"Restoring IPFS"
temp_restore_dir=/root/tempipfs
restore_directory_from_friend $temp_restore_dir ipfs
cp -rf $temp_restore_dir/home/$ADMIN_USERNAME/.ipfs/* /home/$ADMIN_USERNAME/.ipfs
if [ ! "$?" = "0" ]; then
rm -rf $temp_restore_dir
exit 276
fi
rm -rf $temp_restore_dir
fi
}
function restore_ssh_keys {
if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'ssh' ]]; then
@ -1127,7 +1108,6 @@ restore_gpg
restore_procmail
restore_spamassassin
restore_admin_readme
restore_ipfs
restore_ssh_keys
restore_user_config
restore_user_monkeysphere
@ -1136,6 +1116,8 @@ restore_user_local
restore_certs
restore_personal_settings
restore_mailing_list
restore_email
restore_xmpp
restore_gnusocial
restore_hubzilla
@ -1148,7 +1130,6 @@ restore_blog
restore_cjdns
restore_voip
restore_tox
restore_email
restore_dlna
echo $"*** Remote restore was successful ***"