mirror of https://github.com/zulip/zulip.git
Script to automate creating a database for Humbug.
(imported from commit d44cd5ca1ab3383a8c262ed287f075cf21e3b129)
This commit is contained in:
parent
9c1b2665c0
commit
903fbbe38e
|
@ -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
|
Loading…
Reference in New Issue