qr_ynh/scripts/restore

30 lines
1.2 KiB
Plaintext
Raw Normal View History

2019-08-13 21:35:51 +02:00
#!/bin/bash
source ../settings/scripts/_common.sh
2019-08-13 21:35:51 +02:00
source /usr/share/yunohost/helpers
ynh_abort_if_errors
ynh_script_progression --message="Loading installation settings..."
2019-08-13 21:35:51 +02:00
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)
2022-03-03 17:58:37 +01:00
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
2019-08-13 21:35:51 +02:00
2020-10-25 16:31:23 +01:00
ynh_script_progression --message="Recreating the dedicated system user..."
2022-03-03 17:58:37 +01:00
ynh_system_user_create --username=$app --home_dir="$final_path"
2019-08-13 21:35:51 +02:00
2022-03-03 17:58:37 +01:00
ynh_script_progression --message="Restoring the app main directory..."
ynh_restore_file --origin_path="$final_path"
libreqr_apply_filesystem_permissions
2019-08-13 21:35:51 +02:00
2022-03-05 02:39:55 +01:00
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
2019-08-13 21:35:51 +02:00
ynh_script_progression --message="Restoring the NGINX configuration..."
2022-03-05 15:05:40 +01:00
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_systemd_action --service_name=nginx --action=reload
2020-10-31 22:01:13 +01:00
ynh_script_progression --message="Restoration completed for $app" --last