mirror of
https://github.com/YunoHost-Apps/reverseproxy_ynh.git
synced 2024-09-03 20:16:23 +02:00
34 lines
1.1 KiB
Bash
34 lines
1.1 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source ../settings/scripts/_common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# REVERSEPROXY_YNH
|
|
#=================================================
|
|
|
|
# Revalidate destination path
|
|
rp_validate_proxy_path "$proxy_path"
|
|
|
|
# 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."
|
|
|
|
# Restore configuration files
|
|
ynh_restore_file "$NGINX_CONF"
|
|
|
|
# Reload nginx
|
|
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
|
ynh_systemd_action --service_name=nginx --action=reload
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Restoration completed for $app" --last
|