From 2c3746c596dc0c1b3d6e89cf11ca66ecff45e549 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 1 Oct 2024 20:59:30 +0800 Subject: [PATCH] Update mw.tpl --- scripts/init.d/mw.tpl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index 03a86aea8..78d6412c7 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -437,8 +437,9 @@ mw_connect_pgdb(){ pwd=$(cd ${ROOT_PATH}/mdserver-web && python3 ${ROOT_PATH}/mdserver-web/plugins/postgresql/index.py root_pwd) - echo "${ROOT_PATH}/postgresql/bin/psql -U postgres -W "${pwd}"" - ${ROOT_PATH}/postgresql/bin/psql -U postgres -W + export PGPASSWORD=${pwd} + echo "${ROOT_PATH}/postgresql/bin/psql -U postgres -W" + echo "\n" | ${ROOT_PATH}/postgresql/bin/psql -U postgres -W }