From 01430e1ef726eb20494cff7ec0d738a4150048d5 Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Fri, 28 Jul 2023 19:10:05 +0200 Subject: [PATCH] Make sure that restore & upgrade script also use required PHP version --- scripts/restore | 8 +++++--- scripts/upgrade | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/restore b/scripts/restore index 2c9b96b..315f8af 100755 --- a/scripts/restore +++ b/scripts/restore @@ -70,7 +70,9 @@ chown -R $app:www-data "$final_path" #================================================= # RESTORE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Restoring the MySQL database..." +ynh_script_progression --message="Restoring the database..." + +ynh_install_app_dependencies $pkg_dependencies_main if [ $database -eq 1 ]; then ynh_script_progression --message="Restoring MySQL database..." @@ -78,10 +80,10 @@ if [ $database -eq 1 ]; then ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name --db_pwd=$db_pwd ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ./db.sql elif [ $database -eq 2 ]; then - # Removing postgresql database + # Reinstalling postgresql database ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies - ynh_install_app_dependencies $pkg_dependencies + ynh_install_app_dependencies $pkg_dependencies_psql ynh_script_progression --message="Restoring the PostgreSQL database..." db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) ynh_psql_test_if_first_run diff --git a/scripts/upgrade b/scripts/upgrade index 85acf9c..f15212e 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -200,8 +200,10 @@ chmod 644 "/etc/cron.d/$app" #================================================= ynh_script_progression --message="Upgrading dependencies..." +ynh_install_app_dependencies $pkg_dependencies_main + if [ $database -eq 2 ]; then - ynh_install_app_dependencies $pkg_dependencies + ynh_install_app_dependencies $pkg_dependencies_psql fi #=================================================