fluentd-concenter/entrypoint.sh
Stefan Reimer ad5bbc0089
All checks were successful
ZeroDownTime/fluentd-concenter/pipeline/tag This commit looks good
ZeroDownTime/fluentd-concenter/pipeline/head This commit looks good
fix: cleanup entrypoint
2023-12-13 17:54:52 +00:00

27 lines
760 B
Bash
Executable File

#!/bin/sh
# If the user has supplied only arguments append them to `fluentd` command
if [ "${1#-}" != "$1" ]; then
set -- fluentd "$@"
fi
# If user does not supply config file or plugins, use the default
if [ "$1" = "fluentd" ]; then
if ! echo $@ | grep -e ' \-c' -e ' \-\-config' ; then
set -- "$@" --config /fluentd/etc/${FLUENTD_CONF}
fi
if ! echo $@ | grep -e ' \-p' -e ' \-\-plugin' ; then
set -- "$@" --plugin /fluentd/plugins
fi
SIMPLE_SNIFFER=$( gem contents fluent-plugin-elasticsearch | grep elasticsearch_simple_sniffer.rb )
if [ -n "$SIMPLE_SNIFFER" -a -f "$SIMPLE_SNIFFER" ] ; then
set -- "$@" -r $SIMPLE_SNIFFER
fi
set -- "$@" --gemfile /fluentd/Gemfile
fi
exec "$@" ${FLUENTD_OPT}