reverseproxy_ynh/scripts/restore

35 lines
1.1 KiB
Text
Raw Normal View History

2016-06-20 23:43:51 +02:00
#!/bin/bash
2018-05-26 10:27:01 +02:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2016-06-20 23:43:51 +02:00
2023-01-08 14:33:31 +01:00
source ../settings/scripts/_common.sh
2018-05-26 10:27:01 +02:00
source /usr/share/yunohost/helpers
#=================================================
# REVERSEPROXY_YNH
#=================================================
2023-01-08 14:33:31 +01:00
# Revalidate destination path
rp_validate_proxy_path "$proxy_path"
2016-06-20 23:43:51 +02:00
# Check configuration files
NGINX_CONF="/etc/nginx/conf.d/${domain}.d/${app}.conf"
[[ -f $NGINX_CONF ]] && ynh_die "The NGINX configuration already exists at '${NGINX_CONF}'. You should safely delete it before restoring this app."
2016-06-20 23:43:51 +02:00
# Restore configuration files
2019-05-15 18:42:44 +02:00
ynh_restore_file "$NGINX_CONF"
2016-06-20 23:43:51 +02:00
2023-01-08 14:33:31 +01:00
# Reload nginx
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload
2021-01-23 15:21:17 +01:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Restoration completed for $app" --last