From ee497d68d00d2b882697d46446710ba42daed337 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Sun, 29 Nov 2015 19:05:08 +0530 Subject: [PATCH] sed variable expansion works by default when double quotes are used --- runtime/functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/functions b/runtime/functions index 743889a..d2f1d86 100755 --- a/runtime/functions +++ b/runtime/functions @@ -65,7 +65,7 @@ set_postgresql_param() { local current=$(exec_as_postgres sed -n -e "s/^\("${key}" = '\)\([^ ']*\)\(.*\)$/\2/p" ${PG_CONF}) if [[ "${current}" != "${value}" ]]; then echo "‣ Setting postgresql.conf parameter: ${key} = '${value}'" - exec_as_postgres sed -i "s|^[#]*[ ]*"${key}" = .*|"${key}" = '"${value}"'|" ${PG_CONF} + exec_as_postgres sed -i "s|^[#]*[ ]*${key} = .*|${key} = '${value}'|" ${PG_CONF} fi fi } @@ -81,7 +81,7 @@ set_recovery_param() { true) echo "‣ Setting primary_conninfo parameter: ${key}" ;; *) echo "‣ Setting primary_conninfo parameter: ${key} = '${value}'" ;; esac - exec_as_postgres sed -i "s|"${key}"=[^ ']*|"${key}"="${value}"|" ${PG_RECOVERY_CONF} + exec_as_postgres sed -i "s|${key}=[^ ']*|${key}=${value}|" ${PG_RECOVERY_CONF} fi fi }