Move hubzilla local restore to app script

This commit is contained in:
Bob Mottram 2016-07-09 10:40:36 +01:00
parent e2ad22bd2d
commit f19b65bd8f
2 changed files with 28 additions and 22 deletions

View File

@ -76,10 +76,38 @@ function backup_local_hubzilla {
fi
}
function restore_local_hubzilla {
if ! grep -q "Hubzilla domain" $COMPLETION_FILE; then
return
fi
HUBZILLA_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Hubzilla domain" | awk -F ':' '{print $2}')
if [ $HUBZILLA_DOMAIN_NAME ]; then
echo $"Restoring Hubzilla"
temp_restore_dir=/root/temphubzilla
hubzilla_dir=/var/www/${HUBZILLA_DOMAIN_NAME}/htdocs
restore_database hubzilla ${HUBZILLA_DOMAIN_NAME}
if [ -d $USB_MOUNT/backup/hubzilla ]; then
if [ ! -d $hubzilla_dir/store/[data]/smarty3 ]; then
mkdir -p $hubzilla_dir/store/[data]/smarty3
fi
chmod 777 $hubzilla_dir/store/[data]/smarty3
chown -R www-data:www-data $hubzilla_dir/*
if [ -d $temp_restore_dir ]; then
rm -rf $temp_restore_dir
fi
fi
echo $"Restore of Hubzilla complete"
fi
}
function backup_remote_hubzilla {
echo -n ''
}
function restore_remote_hubzilla {
echo -n ''
}
function remove_hubzilla {
if ! grep -Fxq "install_hubzilla" $COMPLETION_FILE; then
return

View File

@ -840,27 +840,6 @@ function restore_gnusocial {
fi
}
function restore_hubzilla {
if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'hubzilla' ]]; then
return
fi
fi
if [ $HUBZILLA_DOMAIN_NAME ]; then
restore_database hubzilla ${HUBZILLA_DOMAIN_NAME}
if [ -d $USB_MOUNT/backup/hubzilla ]; then
if [ ! -d /var/www/${HUBZILLA_DOMAIN_NAME}/htdocs/store/[data]/smarty3 ]; then
mkdir -p /var/www/${HUBZILLA_DOMAIN_NAME}/htdocs/store/[data]/smarty3
fi
chmod 777 /var/www/${HUBZILLA_DOMAIN_NAME}/htdocs/store/[data]/smarty3
chown -R www-data:www-data /var/www/${HUBZILLA_DOMAIN_NAME}/htdocs/*
if [ -d /root/temphubzilla ]; then
rm -rf /root/temphubzilla
fi
fi
fi
}
function restore_email {
if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'email' ]]; then
@ -951,7 +930,6 @@ restore_mailing_list
restore_ipfs
restore_xmpp
restore_gnusocial
restore_hubzilla
restore_email
restore_apps