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

Fix restore script bug; Added notes to _common.sh

This commit is contained in:
oleole39 2023-01-23 04:01:10 +01:00
parent 43d9cafec7
commit 81519393b2
2 changed files with 3 additions and 3 deletions

View file

@ -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 if [ -n "$dbs_to_drop" ]; then # Check that the list of database(s) is not empty
local db_name 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 do
if ynh_psql_database_exists --database=$db_name; then # Check if the database exists if ynh_psql_database_exists --database=$db_name; then # Check if the database exists
ynh_psql_drop_db $db_name # Remove the database 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 if [ -n "$dbs_to_dump" ]; then # Check that the list of database(s) is not empty
local db_name 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 do
if ynh_psql_database_exists --database=$db_name; then # Check if the database exists 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 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

View file

@ -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_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 # GENERIC FINALIZATION