fix: shellcheck warnings in docker run.sh (#12377)
Ilya Mashchenko committed
Mar 14, 2022 at 15:03 UTC
4267a14c4d55b288904155346c275c08b805da20
1 file changed
+3
-3
packaging/docker/run.sh
+3
-3
@@ -21,8 +21,8 @@ if [ ! "${DISABLE_TELEMETRY:-0}" -eq 0 ] ||
21
touch /etc/netdata/.opt-out-from-anonymous-statistics
22
fi
23
24
-BALENA_PGID=$(ls -nd /var/run/balena.sock | awk '{print $4}')
25
-DOCKER_PGID=$(ls -nd /var/run/docker.sock | awk '{print $4}')
24
+BALENA_PGID=$(stat -c %g /var/run/balena.sock 2>/dev/null || true)
25
+DOCKER_PGID=$(stat -c %g /var/run/docker.sock 2>/dev/null || true)
26
27
re='^[0-9]+$'
28
if [[ $BALENA_PGID =~ $re ]]; then
@@ -32,7 +32,7 @@ if [[ $BALENA_PGID =~ $re ]]; then
32
elif [[ $DOCKER_PGID =~ $re ]]; then
33
echo "Netdata detected docker.sock"
34
DOCKER_HOST="/var/run/docker.sock"
35
- PGID=$(ls -nd /var/run/docker.sock | awk '{print $4}')
35
+ PGID="$DOCKER_PGID"
36
fi
37
export PGID
38
export DOCKER_HOST