You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
529 B

  1. #!/bin/bash
  2. set -e
  3. . lib/common
  4. PASSWORD="$(relation-get password)"
  5. USER="$(relation-get user)"
  6. DBNAME="$(relation-get dbname)"
  7. HOST="$(relation-get host)"
  8. PORT="$(relation-get port)"
  9. control=$(p0 "$USER" "$DBNAME" "$PASSWORD" "$HOST" "$PORT" | md5_compat)
  10. cfg-merge "
  11. database:
  12. name: psycopg2
  13. args:
  14. user: $USER
  15. password: $PASSWORD
  16. database: $DBNAME
  17. host: $HOST
  18. port: $PORT
  19. cp_min: 5
  20. cp_max: 10
  21. "
  22. relation-set control "$control"
  23. info "Configured $SERVICE_NAME code for $HOST:$PORT access."