From 1bb6b47537de6ef5e4a58f646d61b9e41a28c68f Mon Sep 17 00:00:00 2001 From: "C.J. Collier" Date: Fri, 23 Feb 2024 11:47:05 -0800 Subject: [PATCH] [user-environment] Using $(hostname -s) vs ${HOSTNAME} Recent change in the hostname implementation has required that we find short hostname using a different mechanism. This patch makes that change. --- user-environment/user-environment.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/user-environment/user-environment.sh b/user-environment/user-environment.sh index 16c583970..90191e67b 100755 --- a/user-environment/user-environment.sh +++ b/user-environment/user-environment.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2015 Google, Inc. +# Copyright 2015,2016,2018,2019,2020,2024 Google, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,9 +27,9 @@ function update_apt_get() { return 1 } -## Only install customize master node by default. +## Only install customize master node(s) by default. ## Delete to customize all nodes. -[[ "${HOSTNAME}" =~ -m$ ]] || exit 0 +[[ "$(hostname -s)" =~ "-m$" ]] || [[ "$(hostname -s)" =~ "-m-[0-9]+$" ]] || exit 0 ## Make global changes here update_apt_get