2020-12-16 19:56:57 +01: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
|
|
|
|
|
|
|
|
#=================================================
|
2021-05-27 13:19:07 +02:00
|
|
|
# RESTORE THE APP MAIN DIR
|
2020-12-16 19:56:57 +01:00
|
|
|
#=================================================
|
2024-06-24 11:25:39 +02:00
|
|
|
ynh_script_progression "Restoring $app main directory..."
|
2020-12-16 19:56:57 +01:00
|
|
|
|
2024-06-24 11:25:39 +02:00
|
|
|
ynh_restore "$install_dir"
|
2021-11-16 10:39:20 +01:00
|
|
|
|
2023-03-23 15:26:20 +01:00
|
|
|
chmod -R o-rwx "$install_dir"
|
|
|
|
chown -R $app:www-data "$install_dir"
|
2021-11-16 10:39:20 +01:00
|
|
|
|
2020-12-16 19:56:57 +01:00
|
|
|
#=================================================
|
|
|
|
# RESTORE THE PHP-FPM CONFIGURATION
|
|
|
|
#=================================================
|
2024-06-24 11:25:39 +02:00
|
|
|
ynh_script_progression "Restoring PHP-FPM configuration..."
|
2020-12-16 19:56:57 +01:00
|
|
|
|
2024-06-24 11:25:39 +02:00
|
|
|
ynh_restore "/etc/php/$php_version/fpm/pool.d/$app.conf"
|
2021-12-09 11:50:09 +01:00
|
|
|
|
2024-06-24 11:25:39 +02:00
|
|
|
ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
|
2023-01-12 09:28:16 +01:00
|
|
|
|
2020-12-16 19:56:57 +01:00
|
|
|
#=================================================
|
|
|
|
# RELOAD NGINX AND PHP-FPM
|
|
|
|
#=================================================
|
2024-06-24 11:25:39 +02:00
|
|
|
ynh_script_progression "Reloading NGINX web server and PHP-FPM..."
|
2020-12-16 19:56:57 +01:00
|
|
|
|
2024-06-24 11:25:39 +02:00
|
|
|
ynh_systemctl --service=php$php_version-fpm --action=reload
|
|
|
|
ynh_systemctl --service=nginx --action=reload
|
2020-12-16 19:56:57 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2024-06-24 11:25:39 +02:00
|
|
|
ynh_script_progression "Restoration completed for $app"
|