diff --git a/scripts/restore b/scripts/restore index c733a79..95429e0 100755 --- a/scripts/restore +++ b/scripts/restore @@ -21,14 +21,22 @@ chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" #================================================= -# INSTALL NODEJS +# REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling nodejs version..." --weight=2 +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 + +# Define and install dependencies +ynh_install_nodejs --nodejs_version=$nodejs_version + +#================================================= +# RESTORE SYSTEM CONFIGURATIONS +#================================================= +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -ynh_install_nodejs --nodejs_version=$nodejs_version - ynh_restore_file --origin_path="/var/log/$app/" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" @@ -39,9 +47,11 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" yunohost service add $app --description="Monitoring tool" --log="/var/log/$app/$app.log" #================================================= -# START SYSTEMD SERVICE +# GENERIC FINALIZATION #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 +# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE +#================================================= +ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"