2015-02-01 03:21:28 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-05-29 21:34:42 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2015-02-01 03:21:28 +01:00
|
|
|
|
2019-05-29 21:34:42 +02:00
|
|
|
source ../settings/scripts/_common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
2015-02-01 03:21:28 +01:00
|
|
|
|
2019-05-29 21:34:42 +02:00
|
|
|
#=================================================
|
|
|
|
# STANDARD RESTORATION STEPS
|
|
|
|
#=================================================
|
|
|
|
# RESTORE THE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
2021-09-10 21:24:22 +02:00
|
|
|
ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1
|
2019-05-29 21:34:42 +02:00
|
|
|
|
|
|
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|
|
|
|
|
|
|
#=================================================
|
2021-09-10 21:24:22 +02:00
|
|
|
# RESTORE THE APP MAIN DIR
|
2019-05-29 21:34:42 +02:00
|
|
|
#=================================================
|
2021-09-10 21:24:22 +02:00
|
|
|
ynh_script_progression --message="Restoring the app main directory..." --weight=1
|
|
|
|
|
2023-06-12 19:18:10 +02:00
|
|
|
ynh_restore_file --origin_path="$install_dir"
|
2019-05-29 21:34:42 +02:00
|
|
|
|
2023-06-12 19:18:10 +02:00
|
|
|
chmod -R o-rwx "$install_dir"
|
|
|
|
chown -R $app:www-data "$install_dir"
|
2019-05-29 21:34:42 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALIZATION
|
|
|
|
#=================================================
|
|
|
|
# RELOAD NGINX AND PHP-FPM
|
|
|
|
#=================================================
|
2021-01-31 18:11:50 +01:00
|
|
|
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
2019-05-29 21:34:42 +02:00
|
|
|
|
|
|
|
ynh_systemd_action --service_name=nginx --action=reload
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Restoration completed for $app" --last
|