#!/bin/bash #================================================= # GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers #================================================= # MANAGE SCRIPT FAILURE #================================================= # Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= # Retrieve arguments app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) proxy_path=$(ynh_app_setting_get --app=$app --key=proxy_path) assets_path=$(ynh_app_setting_get --app=$app --key=assets_path) #================================================= # 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