murano-apps/io.murano.databases.PostgreSql/Resources/scripts/assignPostgreSqlUser.sh

6 lines
191 B
Bash

#!/bin/bash
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE $1 to $2"
tee --append /etc/postgresql/*/main/pg_hba.conf <<< "host $1 $2 all md5"
sudo /etc/init.d/postgresql restart