1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/sogo_ynh.git synced 2024-09-03 20:26:07 +02:00
sogo_ynh/scripts/restore

48 lines
1.7 KiB
Bash
Executable file

#!/bin/bash
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# RESTORE THE MYSQL DATABASE
#=================================================
ynh_script_progression "Restoring the MySQL database..."
ynh_mysql_db_shell < ./db.sql
#=================================================
# RESTORE VARIOUS FILES
#=================================================
ynh_script_progression "Restoring various files..."
ynh_restore_everything
#=================================================
# RESTORE SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression "Restoring system configurations related to $app..."
yunohost service add "sogo" --description="Groupware for E-Mail, Contacts and Calender" --log="/var/log/$app/$app.log"
set_permissions
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression "Starting $app's systemd service..."
ynh_systemctl --service="$app" --action="restart" --log_path="systemd"
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression "Reloading NGINX web server..."
ynh_systemctl --service="nginx" --action=reload
# Use logrotate to manage app-specific logfile(s)
ynh_config_add_logrotate "/var/log/$app/sogo.log"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Restoration completed for $app"