#!/bin/bash
FLUENTD_CONF=${FLUENTD_CONF:-"fluentd.conf"}
CONF_FILE="/opt/bitnami/fluentd/conf/${FLUENTD_CONF}"
if [ ! -e ${CONF_FILE} ]; then
echo "==> Writing config file..."
cat > ${CONF_FILE} << EOF
@type forward
@id input1
@label @mainstream
port 24224
@type stdout
# Include config files in the ./config.d directory
@include config.d/*.conf
EOF
else
echo "==> Detected config file. It would be used instead of creating one."
fi
eval "$@"