Skip to content

Commit 71683dc

Browse files
committed
Fix root user check on alpine
1 parent 19c33c9 commit 71683dc

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

telegraf/1.18/alpine/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if [ "${1:0:1}" = '-' ]; then
55
set -- telegraf "$@"
66
fi
77

8-
if [ $EUID -ne 0 ]; then
8+
if [ "$(id -u)" -ne 0 ]; then
99
exec "$@"
1010
else
1111
exec su-exec telegraf "$@"

telegraf/1.19/alpine/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if [ "${1:0:1}" = '-' ]; then
55
set -- telegraf "$@"
66
fi
77

8-
if [ $EUID -ne 0 ]; then
8+
if [ "$(id -u)" -ne 0 ]; then
99
exec "$@"
1010
else
1111
exec su-exec telegraf "$@"

telegraf/1.20/alpine/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if [ "${1:0:1}" = '-' ]; then
55
set -- telegraf "$@"
66
fi
77

8-
if [ $EUID -ne 0 ]; then
8+
if [ "$(id -u)" -ne 0 ]; then
99
exec "$@"
1010
else
1111
exec su-exec telegraf "$@"

0 commit comments

Comments
 (0)