summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlya Mashchenko <ilya@netdata.cloud>2022-03-14 15:03:07 +0200
committerGitHub <noreply@github.com>2022-03-14 15:03:07 +0200
commit4267a14c4d55b288904155346c275c08b805da20 (patch)
treecb03c235786cd5666e0f5ac4fb6264828cbf5594
parent4f7d29eed5e917624c818413928d05697558f5bb (diff)
fix: shellcheck warnings in docker run.sh (#12377)
-rwxr-xr-xpackaging/docker/run.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/packaging/docker/run.sh b/packaging/docker/run.sh
index d7c9cc7f20..e0fa697f7c 100755
--- a/packaging/docker/run.sh
+++ b/packaging/docker/run.sh
@@ -21,8 +21,8 @@ if [ ! "${DISABLE_TELEMETRY:-0}" -eq 0 ] ||
touch /etc/netdata/.opt-out-from-anonymous-statistics
fi
-BALENA_PGID=$(ls -nd /var/run/balena.sock | awk '{print $4}')
-DOCKER_PGID=$(ls -nd /var/run/docker.sock | awk '{print $4}')
+BALENA_PGID=$(stat -c %g /var/run/balena.sock 2>/dev/null || true)
+DOCKER_PGID=$(stat -c %g /var/run/docker.sock 2>/dev/null || true)
re='^[0-9]+$'
if [[ $BALENA_PGID =~ $re ]]; then
@@ -32,7 +32,7 @@ if [[ $BALENA_PGID =~ $re ]]; then
elif [[ $DOCKER_PGID =~ $re ]]; then
echo "Netdata detected docker.sock"
DOCKER_HOST="/var/run/docker.sock"
- PGID=$(ls -nd /var/run/docker.sock | awk '{print $4}')
+ PGID="$DOCKER_PGID"
fi
export PGID
export DOCKER_HOST