Script to automate creating a database for Humbug.

(imported from commit d44cd5ca1ab3383a8c262ed287f075cf21e3b129)
This commit is contained in:
Luke Faraone 2013-02-25 15:46:36 -05:00
parent 9c1b2665c0
commit 903fbbe38e
1 changed files with 16 additions and 0 deletions

16
tools/postgres-init-db Executable file
View File

@ -0,0 +1,16 @@
#/bin/sh -xe
PASSWORD=xxxxxxxxxxxx
sudo -u postgres psql << EOF
DROP SCHEMA public CASCADE;
CREATE DATABASE humbug;
CREATE USER humbug WITH PASSWORD '$PASSWORD';
GRANT ALL ON DATABASE humbug TO humbug;
EOF
echo "Database created"
umask go-rw
echo "*:*:*:humbug:$PASSWORD" >> ~/.pgpass
chmod go-rw ~/.pgpass