Move remote mediagoblin restore to app script

This commit is contained in:
Bob Mottram 2016-07-10 14:34:08 +01:00
parent e9ce9cc79e
commit ffb76f5d1d
2 changed files with 17 additions and 24 deletions

View File

@ -71,7 +71,22 @@ function backup_remote_mediagoblin {
}
function restore_remote_mediagoblin {
echo -n ''
if grep -q "Mediagoblin domain" $COMPLETION_FILE; then
MEDIAGOBLIN_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Mediagoblin domain" | awk -F ':' '{print $2}')
if [ -d $SERVER_DIRECTORY/backup/mediagoblin ]; then
echo $"Restoring Mediagoblin installation"
temp_restore_dir=/root/tempmediagoblin
function_check restore_directory_from_friend
restore_directory_from_friend $temp_restore_dir mediagoblin
cp -r $temp_restore_dir/* /
if [ ! "$?" = "0" ]; then
exit 5626
fi
rm -rf $temp_restore_dir
echo $"Restore of Mediagoblin complete"
fi
chown -hR mediagoblin:www-data /var/www/$MEDIAGOBLIN_DOMAIN_NAME/htdocs
fi
}
function remove_mediagoblin {

View File

@ -666,28 +666,6 @@ function restore_mailing_list {
fi
}
function restore_mediagoblin {
if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'mediagoblin' ]]; then
return
fi
fi
if grep -q "Mediagoblin domain" $COMPLETION_FILE; then
MEDIAGOBLIN_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Mediagoblin domain" | awk -F ':' '{print $2}')
if [ -d $SERVER_DIRECTORY/backup/mediagoblin ]; then
echo $"Restoring Mediagoblin installation"
temp_restore_dir=/root/tempmediagoblin
restore_directory_from_friend $temp_restore_dir mediagoblin
cp -r $temp_restore_dir/* /
if [ ! "$?" = "0" ]; then
exit 5626
fi
rm -rf $temp_restore_dir
fi
chown -hR mediagoblin:www-data /var/www/$MEDIAGOBLIN_DOMAIN_NAME/htdocs
fi
}
function restore_gogs {
export GVM_ROOT=$GVM_HOME
if [ -d $GVM_ROOT/bin ]; then
@ -954,8 +932,8 @@ restore_certs
restore_personal_settings
restore_mailing_list
restore_email
#restore_apps remote
restore_mediagoblin
restore_gogs
restore_wiki
restore_blog