diff --git a/scripts/_common.sh b/scripts/_common.sh index 3baec23..1c929d5 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -109,7 +109,7 @@ ynh_psql_remove_all_user_dbs() { if [ -n "$dbs_to_drop" ]; then # Check that the list of database(s) is not empty local db_name - for db_name in $dbs_to_drop # Iterate through the list of database(s) to remove + for db_name in $dbs_to_drop # Iterate through the list of database(s) to remove. Note: this would fail in case databases names would contain space character or characters such as "*". IFS parsing method would then be required. do if ynh_psql_database_exists --database=$db_name; then # Check if the database exists ynh_psql_drop_db $db_name # Remove the database @@ -143,7 +143,7 @@ ynh_psql_dump_all_user_dbs() { if [ -n "$dbs_to_dump" ]; then # Check that the list of database(s) is not empty local db_name - for db_name in $dbs_to_dump # Iterate through the list of database(s) to dump + for db_name in $dbs_to_dump # Iterate through the list of database(s) to dump. Note: this would fail in case databases names would contain space character or characters such as "*". IFS parsing method would then be required. do if ynh_psql_database_exists --database=$db_name; then # Check if the database exists ynh_psql_dump_db $db_name > "$app-$db_name-dump.sql" # Dump the database to a filename format of app-db_name-dump.sql, or of db_name-dump.sql if app parameter was not supplied diff --git a/scripts/restore b/scripts/restore index 9513c37..5d0ac21 100755 --- a/scripts/restore +++ b/scripts/restore @@ -85,7 +85,7 @@ ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= ynh_script_progression --message="Restoring the PostgreSQL database..." -ynh_psql_restore_all_app_dbs_dumps --db_user=db_user --db_user_pwd=db_user_pwd +ynh_psql_restore_all_app_dbs_dumps --db_user=$db_user --db_user_pwd=db_user_pwd #================================================= # GENERIC FINALIZATION