2017-10-28 19:28:51 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2020-06-28 23:43:03 +02:00
|
|
|
source ../settings/scripts/_common.sh
|
2017-10-28 19:28:51 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD RESTORATION STEPS
|
|
|
|
#=================================================
|
|
|
|
# RESTORE THE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# RESTORE THE APP MAIN DIR
|
|
|
|
#=================================================
|
2020-06-28 23:43:03 +02:00
|
|
|
ynh_script_progression --message="Restoring the app main directory..." --weight=3
|
2017-10-28 19:28:51 +02:00
|
|
|
|
2023-05-07 18:50:05 +02:00
|
|
|
ynh_restore_file --origin_path="$install_dir"
|
2020-06-28 23:43:03 +02:00
|
|
|
|
2017-10-28 19:28:51 +02:00
|
|
|
# Restore permissions on app files
|
2023-05-07 18:50:05 +02:00
|
|
|
chmod 750 $install_dir
|
|
|
|
chown -R www-data: $install_dir
|
2017-10-28 19:28:51 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALIZATION
|
|
|
|
#=================================================
|
|
|
|
# RELOAD NGINX
|
|
|
|
#=================================================
|
2020-11-17 09:08:16 +01:00
|
|
|
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
2020-06-28 23:43:03 +02:00
|
|
|
|
|
|
|
ynh_systemd_action --service_name=nginx --action=reload
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
2017-10-28 19:28:51 +02:00
|
|
|
|
2020-06-28 23:43:03 +02:00
|
|
|
ynh_script_progression --message="Restoration completed for $app" --last
|