]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2225] allow PGPASSWORD to be set from outside admin-utils.sh
authorAndrei Pavel <andrei@isc.org>
Tue, 25 Jan 2022 08:08:22 +0000 (10:08 +0200)
committerAndrei Pavel <andrei@isc.org>
Tue, 25 Jan 2022 08:08:22 +0000 (10:08 +0200)
src/bin/admin/admin-utils.sh

index 91b401286d1fc02bbb34cc7e89ea44312b64164e..7801eae2af58e6cf8de8557a5859e1f9d58faed9 100644 (file)
@@ -135,7 +135,8 @@ pgsql_execute() {
     if test -z "${PGPASSWORD-}"; then
         PGPASSWORD="${db_password}"
     fi
-    export PGPASSWORD="${db_password}"
+    export PGPASSWORD
+
     if [ $# -gt 0 ]; then
         printf '%s' "${QUERY}" | psql --set ON_ERROR_STOP=1 -A -t \
         -h "${db_host}" ${db_port_full_parameter-} -q -U "${db_user}" \
@@ -160,7 +161,8 @@ pgsql_execute_script() {
     if test -z "${PGPASSWORD-}"; then
         PGPASSWORD="${db_password}"
     fi
-    export PGPASSWORD=$db_password
+    export PGPASSWORD
+
     if [ $# -gt 0 ]; then
         psql --set ON_ERROR_STOP=1 -A -t -h "${db_host}" \
         ${db_port_full_parameter-} -q -U "${db_user}" -d "${db_name}" \