Skip to content

Commit

Permalink
Prep for future telegraf-less container
Browse files Browse the repository at this point in the history
  • Loading branch information
kx1t committed Oct 31, 2023
1 parent c9a2a94 commit 9a879a6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion rootfs/etc/s6-overlay/scripts/telegraf
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@

set -eo pipefail

# Check if the telegraf binary exists:
if [[ ! -f /usr/bin/telegraf ]]; then
s6wrap --quiet --timestamps --prepend="$(basename "$0")" --args echo "Telegraf not available in this container, use \"image: ghcr.io/sdr-enthusiasts/docker-dump978:telegraf\" instead"
sleep infinity
fi

if [[ -n "$INFLUXDBURL" ]] || [ -n "$ENABLE_PROMETHEUS" ]; then

#shellcheck disable=SC2016
exec s6wrap --quiet --timestamps --prepend="$(basename "$0")" --args telegraf \
--config /etc/telegraf/telegraf.conf \
--config-directory /etc/telegraf/telegraf.d \

| grep -v "Error in plugin"
else
sleep infinity
fi
5 changes: 5 additions & 0 deletions rootfs/etc/s6-overlay/scripts/telegraf_socat
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

set -eo pipefail

# Check if the telegraf binary exists:
if [[ ! -f /usr/bin/telegraf ]]; then
sleep infinity
fi

if [ -z "$INFLUXDB_SKIP_AIRCRAFT" ] && { [ -n "$INFLUXDBURL" ] || [ -n "$ENABLE_PROMETHEUS" ]; } then

SOCAT_BIN="$(which socat)"
Expand Down

0 comments on commit 9a879a6

Please sign in to comment.