diff --git a/plugins/postgresql/index.py b/plugins/postgresql/index.py index 9c3667d16..1f48829ae 100755 --- a/plugins/postgresql/index.py +++ b/plugins/postgresql/index.py @@ -276,7 +276,12 @@ def initPgPwd(): data = mw.execShell(cmd_pass) cmd_pass = "echo \"alter user postgres with password '" + pwd + "'\" | " - cmd_pass = cmd_pass + serverdir + '/bin/psql -d postgres' + + if not mw.isAppleSystem(): + cmd_pass = cmd_pass + ' su - postgres -c "' + \ + serverdir + '/bin/psql" -d postgres' + else: + cmd_pass = cmd_pass + serverdir + '/bin/psql -d postgres' data = mw.execShell(cmd_pass) # print(cmd_pass) # print(data)