Correct shell quoting around $DEFAULT_USER in terminate-psql-sessions

Previously, we used shell quoting that would result in the shell variable not
being substituted. Instead, we use `"`s that will allow for variable
substitution.
This commit is contained in:
Luke Faraone 2016-02-18 01:48:20 +00:00
parent c89d675462
commit 9d9bfb27ef
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ else
fi fi
if [ "$EUID" -eq 0 ]; then if [ "$EUID" -eq 0 ]; then
sudo -u "$DEFAULT_USER" sh -c 'psql postgres "$DEFAULT_USER"' <<EOF sudo -u "$DEFAULT_USER" sh -c "psql postgres '$DEFAULT_USER'" <<EOF
SELECT pg_terminate_backend($pidname) FROM pg_stat_activity WHERE datname IN ($tables); SELECT pg_terminate_backend($pidname) FROM pg_stat_activity WHERE datname IN ($tables);
EOF EOF
else else