1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
# File: pgsql.get
# Changes:
# 20010224 Ola Lundqvist <opal@debian.org>
# 20011022 Luca De Vitis <luca@debian.org>
# Allowed reinclusion.
# 20020116 Ola Lundqvist <opal@debian.org>
# Documented the reinclusion.
# 20020126 Ola Lundqvist <opal@debian.org>
# Added defaults for dbadmin and documented all defaults.
# Removed the reinclusion. No high computation and it will work
# fine anyway.
# Needs: $dbserver - the server to connect to (defaults to localhost).
# $dbadmin - the administrator name (defaults to postgres).
# $dbadmpass - the administrator password (not supported).
# Sets: $pgsqlcmd so that administration access are prepared
# $systemdb - the name of the system db.
if [ -z "$dbadmin" ] ; then
dbadmin=postgres
fi
if [ -z "$dbserver" ] ; then
dbserver=localhost
fi
if [ -z "$systemdb" ] ; then
systemdb=template1
fi
if [ "$dbserver" != "localhost" ] ; then
hostopt="-h $dbserver"
fi
passopt=""
pgsqlcmd="sudo -u $dbadmin psql $hostopt $passopt"
|