fork 0k-charms
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.

26 lines
518 B

  1. #!/bin/bash
  2. . lib/common
  3. PASSWORD="$(relation-get password)"
  4. USER="$(relation-get user)"
  5. DBNAME="$(relation-get dbname)"
  6. control=$(H "$USER" "$DBNAME" "$PASSWORD")
  7. [ "$control" == "$(relation-get control || true)" ] && exit 0
  8. set -e
  9. wp-cli:run config create \
  10. --dbname="$DBNAME" \
  11. --dbuser="$USER" \
  12. --dbpass="$PASSWORD" \
  13. --dbhost="$TARGET_SERVICE_NAME" \
  14. --skip-check
  15. relation-set control "$control"
  16. info "Configured wordpress code for mysql access."