Move gnusocial local restore to app script

This commit is contained in:
Bob Mottram 2016-07-09 10:46:05 +01:00
parent f19b65bd8f
commit 781453c7fe
2 changed files with 29 additions and 23 deletions

View File

@ -109,10 +109,39 @@ function backup_local_gnusocial {
fi fi
} }
function restore_local_gnusocial {
if ! grep -q "GNU Social domain" $COMPLETION_FILE; then
return
fi
MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "GNU Social domain" | awk -F ':' '{print $2}')
if [ $MICROBLOG_DOMAIN_NAME ]; then
echo $"Restoring GNU Social"
temp_restore_dir=/root/tempgnusocial
gnusocial_dir=/var/www/${MICROBLOG_DOMAIN_NAME}/htdocs
# stop the daemons
cd $gnusocial_dir
scripts/stopdaemons.sh
restore_database gnusocial ${MICROBLOG_DOMAIN_NAME}
if [ -d $temp_restore_dir ]; then
rm -rf $temp_restore_dir
fi
# start the daemons
cd $gnusocial_dir
scripts/startdaemons.sh
echo $"Restore of GNU Social complete"
fi
}
function backup_remote_gnusocial { function backup_remote_gnusocial {
echo -n '' echo -n ''
} }
function restore_remote_gnusocial {
echo -n ''
}
function remove_gnusocial { function remove_gnusocial {
if ! grep -Fxq "install_gnusocial" $COMPLETION_FILE; then if ! grep -Fxq "install_gnusocial" $COMPLETION_FILE; then
return return

View File

@ -818,28 +818,6 @@ function restore_xmpp {
fi fi
} }
function restore_gnusocial {
if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'gnusocial' ]]; then
return
fi
fi
if [ $MICROBLOG_DOMAIN_NAME ]; then
# stop the daemons
cd /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs
scripts/stopdaemons.sh
restore_database gnusocial ${MICROBLOG_DOMAIN_NAME}
if [ -d /root/tempgnusocial ]; then
rm -rf /root/tempgnusocial
fi
# start the daemons
cd /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs
scripts/startdaemons.sh
fi
}
function restore_email { function restore_email {
if [[ $RESTORE_APP != 'all' ]]; then if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'email' ]]; then if [[ $RESTORE_APP != 'email' ]]; then
@ -929,7 +907,6 @@ restore_mailing_list
restore_ipfs restore_ipfs
restore_xmpp restore_xmpp
restore_gnusocial
restore_email restore_email
restore_apps restore_apps