source: MSI/Discovery/trunk/DI01-LoggingFramework/sql/create_database.sh @ 5421

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/MSI/Discovery/trunk/DI01-LoggingFramework/sql/create_database.sh@5421
Revision 5421, 460 bytes checked in by sdonegan, 10 years ago (diff)

Updated to also create url redirect table creation

Line 
1#!/bin/bash
2
3if [ $# -lt 2 ]
4then
5         echo 1>&2 Usage: $0 username database [hostname] [port]
6         echo 1>&2 - hostname defaults to 'localhost'
7         echo 1>&2 - port defaults to 5432
8         exit 127
9fi
10
11port="5432"
12if [ $# -gt 3 ]
13then
14        port=$4
15fi
16
17host="localhost"
18if [ $# -gt 2 ]
19then
20        host=$3
21fi
22
23dbOptions="-U $1 -d $2 -h $host -p $port"
24echo $dbOptions
25
26psql -f basicLoggingTable.sql $dbOptions
27psql -f basicURLTrackingTable.sql $dbOptions
Note: See TracBrowser for help on using the repository browser.