#!/bin/sh
# Netdisco - netdisco.org 
# Postgresql setup shell script
# $Id: pg_init,v 1.3 2003/07/15 20:29:20 maxbaker Exp $

# Change these to match your setup
# Linux Default 
SYSDBUSER=postgres

# BSD Default
# SYSDBUSER=pgsql

DB=netdisco

CREATEUSER="createuser --no-createdb --no-adduser --pwprompt $DB"

echo "--> Creating User $DB."
echo "Choose a password just for this new database user."
su $SYSDBUSER -c "$CREATEUSER"

echo ""
echo "Creating Database $DB.  Use the Password used above."
su $SYSDBUSER -c "createdb --password $DB"

