From 9b41fefbf86b707958a4138a0843846ee2caede6 Mon Sep 17 00:00:00 2001 From: Roland Stirnimann Date: Fri, 24 Mar 2023 10:05:55 +0100 Subject: [PATCH] Small additional bugfix related to issue #21 to keep newlines during variable processing --- bundle/pgoperate-4.5.tar | Bin 286720 -> 286720 bytes lib/shared.lib | 4 +++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bundle/pgoperate-4.5.tar b/bundle/pgoperate-4.5.tar index a34bcb23a82ef3ba9d548202f233ee55ab177f22..4e2ce7104738d035e5a30af0a950a2fa0cfb0b9b 100644 GIT binary patch delta 123 zcmZoTAlLvzEsR^3dbSCg8<`m!n;I|}7@C-v7&9oCPBvsr+0M9~saqK$XJiJHGd4$( zyUo-RE@5oI0Muas)(%!;YHnb{pkM&eZp^$-kx^;-{t#w8My2gd7@C-v7&9oCPBvsr+0M9~saqK=XKZ2$lruIr zHigUGW@-tSFfwBR>M#IlH!?N@Dls)TFk(n-lsVIKnSzm_V*#og0kEH6*4ou F0|1?aAjJRx diff --git a/lib/shared.lib b/lib/shared.lib index 21ebfea..0a96c7c 100644 --- a/lib/shared.lib +++ b/lib/shared.lib @@ -263,9 +263,11 @@ set_conf_param "$PGSQL_BASE/etc/postgresql.conf" max_wal_senders "10" set_conf_param "$PGSQL_BASE/etc/postgresql.conf" max_replication_slots "10" set_conf_param "$PGSQL_BASE/etc/postgresql.conf" track_commit_timestamp "on" +# Do not remove the double quotes from the while loop input around the "$(echo...)"! +# Those are curcial that newlines within the variable PG_DEF_PARAMS are kept! while read -r param; do [[ ${#param} -gt 0 ]] && set_conf_param "$PGSQL_BASE/etc/postgresql.conf" $(echo $param | cut -s -d"=" -f1) "$(echo $param | cut -s -d"=" -f2-)" -done <<< $(echo "$PG_DEF_PARAMS" | grep -E -v "^[ ]*#") +done <<< "$(echo "$PG_DEF_PARAMS" | grep -E -v "^[ ]*#")" if [[ $PCTMEM -gt 0 ]]; then local membytes=$(free -m | grep Mem | awk '{print $2}')