Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo Database name:
- read dbname
- echo Username:
- read dbuser
- echo Password:
- read -s dbpwd
- echo
- sudo -u postgres psql -c "CREATE DATABASE $dbname;"
- sudo -u postgres psql -c "CREATE USER $dbuser WITH PASSWORD '$dbpwd';"
- sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE $dbname TO $dbuser;"
Add Comment
Please, Sign In to add comment