Guest User

Untitled

a guest
Feb 18th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. bash-3.2$ DATABASE_URL='postgres://username:password@hostname.net:port/dbname'
  2. bash-3.2$ [[ $DATABASE_URL =~ (.*)'://'(.*):(.*)@(.*):(.*)/(.*) ]] && \
  3. DB_USERNAME=${BASH_REMATCH[2]} \
  4. DB_PASSWORD=${BASH_REMATCH[3]} \
  5. DB_HOST=${BASH_REMATCH[4]} \
  6. DB_PORT=${BASH_REMATCH[5]} \
  7. DB_DBNAME=${BASH_REMATCH[6]} env |grep DB_
  8. DB_PORT=port
  9. DB_USERNAME=username
  10. DB_DBNAME=dbname
  11. DB_PASSWORD=password
  12. DB_HOST=hostname.net
Add Comment
Please, Sign In to add comment