Guest User

Untitled

a guest
Feb 11th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. echo Database name:
  4. read dbname
  5.  
  6. echo Username:
  7. read dbuser
  8.  
  9. echo Password:
  10. read -s dbpwd
  11. echo
  12.  
  13. sudo -u postgres psql -c "CREATE DATABASE $dbname;"
  14. sudo -u postgres psql -c "CREATE USER $dbuser WITH PASSWORD '$dbpwd';"
  15. sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE $dbname TO $dbuser;"
Add Comment
Please, Sign In to add comment