From d079b656b4719739b2247dcd9d46e9bec793095a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 Feb 2023 17:11:34 +0100 Subject: Merging upstream version 1.38.0. Signed-off-by: Daniel Baumann --- packaging/docker/run.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'packaging/docker/run.sh') diff --git a/packaging/docker/run.sh b/packaging/docker/run.sh index 1e001256c..9029e22b6 100755 --- a/packaging/docker/run.sh +++ b/packaging/docker/run.sh @@ -49,6 +49,14 @@ if mountpoint -q /etc/netdata && [ -z "$(ls -A /etc/netdata)" ]; then cp -a /etc/netdata.stock/. /etc/netdata fi +if [ -w "/etc/netdata" ]; then + if mountpoint -q /etc/netdata; then + hostname >/etc/netdata/.container-hostname + else + rm -f /etc/netdata/.container-hostname + fi +fi + if [ -n "${NETDATA_CLAIM_URL}" ] && [ -n "${NETDATA_CLAIM_TOKEN}" ] && [ ! -f /var/lib/netdata/cloud.d/claimed_id ]; then # shellcheck disable=SC2086 /usr/sbin/netdata-claim.sh -token="${NETDATA_CLAIM_TOKEN}" \ -- cgit v1.2.3