sync build tree from private myoffice
This commit is contained in:
@@ -29,10 +29,11 @@ msg() { echo -e " ==> $*"; }
|
||||
|
||||
as_postgres() {
|
||||
# Script runs as root in CT; sudo is not installed.
|
||||
# cd away from /root — postgres cannot access it (harmless but noisy otherwise).
|
||||
if command -v runuser >/dev/null 2>&1; then
|
||||
runuser -u postgres -- "$@"
|
||||
(cd /tmp && runuser -u postgres -- "$@")
|
||||
else
|
||||
su -s /bin/bash postgres -c "$*"
|
||||
(cd /tmp && su -s /bin/bash postgres -c "$(printf '%q ' "$@")")
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user