#!/bin/sh

#==============================================================
# author: Karsten Hilbert
# license: GPL v2
#
# This wrapper allows setting the password for gm-dbo.
#
# It must be run as root.
#
#==============================================================

PASSWD="$1"
SQL="ALTER ROLE \\\"gm-dbo\\\" ENCRYPTED PASSWORD '${PASSWD}';"

su -c "psql -d template1 -c \"${SQL}\"" -l postgres

#==============================================================
