summaryrefslogtreecommitdiff
path: root/rt/bin/initacls.Pg
blob: 82e32de74de00d22569eb64c44953aabf3312a03 (plain)
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
#!/bin/sh

DATABASEHOME=$1
HOSTNAME=$2
PORT=$3
DATABASEADMIN=$4
DBAPASSWD=$5
DATABASENAME=$6
DATABASEACLS=$7

BINDIR=${DATABASEHOME}/bin


PATH=$PATH:$BINDIR
export PATH

echo "Enter the postgres administrator's database password to create a new user for rt"

if [ "fnord$PORT" != "fnord" ]; then
	PORT="-p $PORT"
fi;

if [ "fnord$HOSTNAME" != "fnord" ]; then
	HOSTNAME="-h $HOSTNAME"
fi;

psql $HOSTNAME $PORT -d $DATABASENAME -f $DATABASEACLS -U $DATABASEADMIN