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

43 lines
1.4 KiB
Text
Raw Normal View History

2022-04-21 18:30:00 +02:00
#!/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 APP MAIN DIR
#=================================================
2024-06-23 21:13:38 +02:00
ynh_script_progression "Restoring the app main directory..."
2022-04-21 18:30:00 +02:00
2024-06-23 21:13:38 +02:00
ynh_restore "$install_dir"
2022-04-21 18:30:00 +02:00
2024-08-03 22:59:02 +02:00
chmod -R 750 "$install_dir"
2024-08-09 16:09:11 +02:00
chown -R "$app:www-data" "$install_dir"
2024-08-03 22:59:02 +02:00
chmod 600 "$install_dir/app/data/_data_/_default_/configs/application.ini"
2024-08-09 16:09:11 +02:00
chown -R "$app:$app" "$install_dir/app/data/_data_"
2023-02-14 16:38:59 +01:00
2022-04-21 18:30:00 +02:00
#=================================================
2023-02-17 22:06:21 +01:00
# RESTORE SYSTEM CONFIGURATIONS
2022-04-21 18:30:00 +02:00
#=================================================
2024-06-23 21:13:38 +02:00
ynh_script_progression "Restoring system configurations related to $app..."
2022-04-21 18:30:00 +02:00
2024-06-23 21:13:38 +02:00
ynh_restore "/etc/php/$php_version/fpm/pool.d/$app.conf"
2022-12-27 13:58:22 +01:00
2024-06-23 21:13:38 +02:00
ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
2022-04-21 18:30:00 +02:00
2024-06-23 21:13:38 +02:00
ynh_restore "/etc/logrotate.d/$app"
2022-04-21 18:30:00 +02:00
#=================================================
2023-02-17 22:06:21 +01:00
# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE
2022-04-21 18:30:00 +02:00
#=================================================
2024-06-23 21:13:38 +02:00
ynh_script_progression "Reloading NGINX web server and $app's service..."
2022-04-21 18:30:00 +02:00
2024-08-09 16:09:11 +02:00
ynh_systemctl --service="php$php_version-fpm" --action=reload
2024-06-23 21:13:38 +02:00
ynh_systemctl --service=nginx --action=reload
2022-04-21 18:30:00 +02:00
#=================================================
# END OF SCRIPT
#=================================================
2024-06-23 21:13:38 +02:00
ynh_script_progression "Restoration completed for $app"