#!/bin/bash source /usr/share/yunohost/helpers ynh_abort_if_errors ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) ynh_script_progression --message="Recreating the dedicated system user..." ynh_system_user_create --username=$app --home_dir="$final_path" ynh_script_progression --message="Restoring the app main directory..." ynh_restore_file --origin_path="$final_path" chmod -R 440 "$final_path" find "$final_path" -type d | xargs chmod 110 chmod 750 "$final_path"/css chown -R $app:www-data "$final_path" ynh_script_progression --message="Restoring the PHP-FPM configuration..." ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_systemd_action --service_name=nginx --action=reload ynh_script_progression --message="Restoration completed for $app" --last