From da4c8750fcc799a6493db0cf5aee2dd4c1d68f07 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 10 Aug 2022 19:03:35 +0800 Subject: [PATCH] Update index.py --- plugins/postgresql/index.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/postgresql/index.py b/plugins/postgresql/index.py index 6772d47f1..9c3667d16 100755 --- a/plugins/postgresql/index.py +++ b/plugins/postgresql/index.py @@ -272,6 +272,9 @@ def initPgPwd(): serverdir = getServerDir() pwd = mw.getRandomString(16) + cmd_pass = serverdir + '/bin/createuser -s postgres' + data = mw.execShell(cmd_pass) + cmd_pass = "echo \"alter user postgres with password '" + pwd + "'\" | " cmd_pass = cmd_pass + serverdir + '/bin/psql -d postgres' data = mw.execShell(cmd_pass) @@ -428,7 +431,6 @@ def runInfo(): res = db.query( "select count(*) from pg_stat_activity where not pid=pg_backend_pid()") - # print(res) result['connections'] = res[0][0] res = db.query("select pg_size_pretty(pg_database_size('postgres'))")