Changeset 3848


Ignore:
Timestamp:
07/05/08 10:08:55 (11 years ago)
Author:
cbyrom
Message:

Adjust create database script to allow specification of port - along with default setting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI01-discovery/branches/ingestAutomation-upgrade/database/create_database.sh

    r3834 r3848  
    11#!/bin/bash 
    22 
    3 if [ $# -ne 3 ] 
     3if [ $# -lt 2 ] 
    44then 
    5          echo 1>&2 Usage: $0 username database hostname 
     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 
    68         exit 127 
    79fi 
    810 
    9 dbOptions="-U $1 -d $2 -h $3" 
     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" 
    1024echo $dbOptions 
    1125 
Note: See TracChangeset for help on using the changeset viewer.