From 7918600d2730b9bbc655c3362ff3a619da65870c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 29 Aug 2023 21:27:56 +0200 Subject: [PATCH] fix --- scripts/restore | 14 +++++++------- scripts/upgrade | 5 +++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/scripts/restore b/scripts/restore index 27f21d5..b9e34be 100644 --- a/scripts/restore +++ b/scripts/restore @@ -20,6 +20,13 @@ ynh_restore_file --origin_path="$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" +#================================================= +# RESTORE THE MYSQL DATABASE +#================================================= +ynh_script_progression --message="Restoring the MySQL database..." --weight=2 + +ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql + #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= @@ -35,13 +42,6 @@ mkdir -p "/var/log/$app" chown $app: "/var/log/$app" ynh_restore_file --origin_path="/etc/logrotate.d/$app" -#================================================= -# RESTORE THE MYSQL DATABASE -#================================================= -ynh_script_progression --message="Restoring the MySQL database..." --weight=2 - -ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 79e7ade..2dcfdd8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -72,9 +72,9 @@ fi #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Updating a configuration file..." --weight=1 +#ynh_script_progression --message="Updating a configuration file..." --weight=1 -(cd $install_dir && ynh_exec_as "$app" php$phpversion bin/cli admin:updateDatabase -e) +#(cd $install_dir && ynh_exec_as "$app" php$phpversion bin/cli admin:updateDatabase -e) #ynh_add_config --template="../conf/ampache.cfg.php" --destination="$install_dir/config/ampache.cfg.php" @@ -96,6 +96,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_local_curl /update.php?action=update sleep 1 + (cd $install_dir && ynh_exec_as "$app" php$phpversion bin/cli admin:updateDatabase -e) fi #=================================================