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