* Remove the 'adduser' code which has been moved to create-user script.
[hcoop/domtool2.git] / src / plugins / domtool-postgres
CommitLineData
d541c618
AC
1#!/bin/sh -e
2
3case $1 in
4 adduser)
2464c83c 5 echo Postgres user was already created during create-user.
d541c618
AC
6 ;;
7 createdb)
a215ab4e
AC
8 USERNAME=$2
9 DBNAME_BASE=$3
10 DBNAME="${USERNAME}_${DBNAME_BASE}"
11
12 sudo -u postgres createdb -O $USERNAME -D user_$USERNAME $DBNAME
d541c618
AC
13 ;;
14 *)
15 echo "Usage: domtool-postgres [adduser <user> | createdb <user> <table>]"
16 ;;
17esac