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-09 16:13:31 +02:00
|
|
|
chmod -R "u=rX,g=rX,o=" "$install_dir"
|
2024-08-09 16:09:11 +02:00
|
|
|
chown -R "$app:www-data" "$install_dir"
|
2024-08-09 16:13:31 +02:00
|
|
|
|
|
|
|
chmod -R "u=rwX,g=,o=" "$install_dir/app/data"
|
|
|
|
chown -R "$app:$app" "$install_dir/app/data"
|
|
|
|
|
|
|
|
chmod "u=rX,g=,o=" "$install_dir/index.php"
|
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"
|