diff --git a/mattermost/hooks/postgres_database-relation-joined b/mattermost/hooks/postgres_database-relation-joined index 5122349a..7c0e0eff 100755 --- a/mattermost/hooks/postgres_database-relation-joined +++ b/mattermost/hooks/postgres_database-relation-joined @@ -18,8 +18,10 @@ services: MM_USERNAME: $USER " -sed -ri 's/(^\s+"DataSource": "postgres:[^:]+:)([^@]+)@/\1'"$PASSWORD"'@/' \ - "$SERVICE_CONFIGSTORE/mattermost/config/config.json" || exit 1 +if [ -e "$SERVICE_CONFIGSTORE/mattermost/config/config.json" ]; then + sed -ri 's/(^\s+"DataSource": "postgres:[^:]+:)([^@]+)@/\1'"$PASSWORD"'@/' \ + "$SERVICE_CONFIGSTORE/mattermost/config/config.json" || exit 1 +fi [ "$control" == "$(relation-get control 2>/dev/null)" ] && exit 0