Advertisement
Guest User

Untitled

a guest
Nov 20th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. # Get nuxeo config parameters as <name>=<value> pairs, one per line.
  2. # grep gets rid of other output.
  3. # Perform replacement so that the results can be assigned to an associative array.
  4. RAW_CONFIG=$(
  5. nuxeoctl --get-regexp config '.' |
  6. grep '=' |
  7. sed -r 's/([^=]*)=(.*)/\[\1\]="\2"/')
  8.  
  9. # Assign transformed results to an associative array.
  10. declare -A CONFIG
  11. eval "CONFIG=(${RAW_CONFIG})"
  12.  
  13. # Export postgresql vars.
  14. export PGPASSWORD="${CONFIG[nuxeo.db.password]}"
  15. export PGUSER="${CONFIG[nuxeo.db.user]}"
  16. export PGDATABASE="${CONFIG[nuxeo.db.name]}"
  17. export PGHOST="${CONFIG[nuxeo.db.host]}"
  18. export PGPORT="${CONFIG[nuxeo.db.port]}"
  19.  
  20. # Export other important things
  21. export NX_DATA_DIR="${CONFIG[nuxeo.data.dir]}"
  22. export NX_S3_BUCKET="${CONFIG[nuxeo.s3storage.bucket]}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement