Created
February 17, 2018 20:43
-
-
Save danthedaniel/df9a652a7c53d2bd95e3c27ffc3311dd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [ ! -z "$1" -a ! -z "$2" -a ! -z "$3" ]; then | |
| psql -c "CREATE USER $1 WITH PASSWORD '$2'" | |
| psql -c "CREATE DATABASE $3" | |
| psql -c "GRANT ALL PRIVILEGES ON DATABASE $3 to $1" | |
| else | |
| echo "Usage: new [user] [password] [database]" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment