mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
scripts: Rename DEFAULT_USER to POSTGRES_USER.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
committed by
Tim Abbott
parent
8a15b9ee87
commit
53879c4673
@@ -1,9 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
DEFAULT_USER="postgres"
|
||||
POSTGRES_USER="postgres"
|
||||
if [ "$(uname)" = "OpenBSD" ]; then
|
||||
DEFAULT_USER="_postgresql"
|
||||
POSTGRES_USER="_postgresql"
|
||||
fi
|
||||
|
||||
cd /
|
||||
@@ -15,7 +15,7 @@ tables="$(printf "'%s'," "${@//\'/\'\'}")"
|
||||
tables="${tables%,}"
|
||||
|
||||
if [ "$EUID" -eq 0 ]; then
|
||||
su - "$DEFAULT_USER" -c "psql postgres '$DEFAULT_USER'" <<EOF
|
||||
su - "$POSTGRES_USER" -c "psql postgres '$POSTGRES_USER'" <<EOF
|
||||
SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname IN ($tables);
|
||||
EOF
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user