Files
hassio-repo/telegraf/entrypoint.sh
2022-06-18 19:30:05 +02:00

32 lines
695 B
Bash
Executable File

#!/bin/bash
set -e
if [ "${1:0:1}" = '-' ]; then
set -- telegraf "$@"
fi
if [ $EUID -ne 0 ]; then
exec "$@"
else
# Allow telegraf to send ICMP packets and bind to privliged ports
setcap cap_net_raw,cap_net_bind_service+ep /usr/bin/telegraf || echo "Failed to set additional capabilities on /usr/bin/telegraf"
echo "env"
env
echo " ############################## "
echo "ls /"
ls /
echo " ############################## "
echo "find /config"
find /config
echo " ############################## "
echo "find /addons"
find /addons
echo " ############################## "
exec setpriv --reuid telegraf --init-groups "$@"
fi