File: pgsql.get

package info (click to toggle)
wwwconfig-common 0.0.19
  • links: PTS
  • area: main
  • in suites: woody
  • size: 356 kB
  • ctags: 1
  • sloc: sh: 900; makefile: 28
file content (31 lines) | stat: -rw-r--r-- 994 bytes parent folder | download
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"