build files for making podman containers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

12 lines
354 B

#!/bin/bash
cmd() {
sudo -u postgres psql -c "$1"
}
cd /var/lib/postgresql
cmd "DROP DATABASE IF EXISTS $DBNAME;"
cmd "DROP USER IF EXISTS $DBUSER;"
cmd "CREATE USER $DBUSER;"
cmd "CREATE DATABASE $DBNAME WITH TEMPLATE template0 ENCODING UTF8 LC_COLLATE 'C.UTF-8' LC_CTYPE 'C.UTF-8';"
cmd "GRANT ALL PRIVILEGES ON DATABASE $DBNAME TO $DBUSER;"