mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
terminate-psql-sessions: Allow running without sudo.
This commit is contained in:
committed by
Tim Abbott
parent
eb7e44f7ed
commit
19fbf9c3cf
@@ -15,7 +15,7 @@ tables="$(printf "'%s'," "${@//\'/\'\'}")"
|
||||
tables="${tables%,}"
|
||||
|
||||
if [ "$EUID" -eq 0 ]; then
|
||||
sudo -u "$DEFAULT_USER" psql postgres "$DEFAULT_USER" <<EOF
|
||||
su - "$DEFAULT_USER" -c "psql postgres '$DEFAULT_USER'" <<EOF
|
||||
SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname IN ($tables);
|
||||
EOF
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user