1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/streams_ynh.git synced 2024-09-03 20:26:20 +02:00

Make sure that restore & upgrade script also use required PHP version

This commit is contained in:
dragondaddy 2023-07-28 19:10:05 +02:00
parent ed49a7b086
commit 01430e1ef7
2 changed files with 8 additions and 4 deletions

View file

@ -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

View file

@ -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
#=================================================