first commit
This commit is contained in:
28
opensem/hooks/mysql_database-relation-joined
Executable file
28
opensem/hooks/mysql_database-relation-joined
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
. lib/common
|
||||
|
||||
PASSWORD="$(relation-get password)"
|
||||
USER="$(relation-get user)"
|
||||
DBNAME="$(relation-get dbname)"
|
||||
|
||||
# control=$(H "$USER" "$DBNAME" "$PASSWORD")
|
||||
|
||||
# [ "$control" == "$(relation-get control || true)" ] && exit 0
|
||||
|
||||
set -e
|
||||
|
||||
cat <<EOF >> "${OPENSEM_CONFIG_FILE}"
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=${TARGET_SERVICE_NAME}
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=$DBNAME
|
||||
DB_USERNAME=$USER
|
||||
DB_PASSWORD=$PASSWORD
|
||||
|
||||
EOF
|
||||
|
||||
# relation-set control "$control"
|
||||
|
||||
info "Configured opensem code for mysql access."
|
||||
Reference in New Issue
Block a user