2021-05-10 15:15:42 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source ../settings/scripts/_common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
2024-01-07 20:58:17 +01:00
|
|
|
# RESTORE THE APP MAIN DIR
|
2021-05-10 15:15:42 +02:00
|
|
|
#=================================================
|
2024-01-07 20:58:17 +01:00
|
|
|
ynh_script_progression --message="Restoring the app main directory..." --weight=1
|
2021-05-10 15:15:42 +02:00
|
|
|
|
2024-01-07 20:58:17 +01:00
|
|
|
ynh_restore_file --origin_path="$install_dir"
|
2021-05-10 15:15:42 +02:00
|
|
|
|
2024-01-07 20:58:17 +01:00
|
|
|
chmod -R o-rwx "$install_dir"
|
|
|
|
chown -R $app:www-data "$install_dir"
|
2021-05-10 15:15:42 +02:00
|
|
|
|
|
|
|
#=================================================
|
2024-01-07 20:58:17 +01:00
|
|
|
# RESTORE SYSTEM CONFIGURATIONS
|
2021-05-10 15:15:42 +02:00
|
|
|
#=================================================
|
2024-01-07 20:58:17 +01:00
|
|
|
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
|
2021-05-10 15:15:42 +02:00
|
|
|
|
2024-04-16 18:19:27 +02:00
|
|
|
synapse_domain=$(ynh_app_setting_get --app="$synapse_app" --key=domain)
|
|
|
|
|
2021-05-10 15:15:42 +02:00
|
|
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
2022-03-01 11:39:34 +01:00
|
|
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/${synapse_domain}.d/$app.endpoint.conf"
|
2021-05-10 15:15:42 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALIZATION
|
|
|
|
#=================================================
|
|
|
|
# RELOAD NGINX
|
|
|
|
#=================================================
|
2021-05-10 15:26:09 +02:00
|
|
|
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
2021-05-10 15:15:42 +02:00
|
|
|
|
|
|
|
ynh_systemd_action --service_name=nginx --action=reload
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Restoration completed for $app" --last
|