Stop and restart daemons when restoring gnusocial from backup

This commit is contained in:
Bob Mottram 2016-05-14 19:51:42 +01:00
parent 665fe8f761
commit 5a30e23944
2 changed files with 17 additions and 0 deletions

View File

@ -836,10 +836,18 @@ function restore_gnu_social {
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
}

View File

@ -701,10 +701,19 @@ function restore_gnu_social {
fi
if grep -q "GNU Social domain" $COMPLETION_FILE; then
MICROBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "GNU Social domain" | awk -F ':' '{print $2}')
# stop the daemons
cd /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs
scripts/stopdaemons.sh
restore_database_from_friend 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
}