This is an automated email from the ASF dual-hosted git repository.
zrhoffman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push:
new b0deb7d Fix CIAB mid enrollment (#5227)
b0deb7d is described below
commit b0deb7d6755e3624bdbe7bb1e3844559b869f879
Author: Rawlin Peters <[email protected]>
AuthorDate: Thu Oct 29 18:20:56 2020 -0600
Fix CIAB mid enrollment (#5227)
The `hostname` command, depending on particular CentOS versions, will
sometimes return the FQDN or the short hostname.
---
infrastructure/cdn-in-a-box/mid/init.d/99-run.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/infrastructure/cdn-in-a-box/mid/init.d/99-run.sh
b/infrastructure/cdn-in-a-box/mid/init.d/99-run.sh
index 936d54e..36a88d7 100755
--- a/infrastructure/cdn-in-a-box/mid/init.d/99-run.sh
+++ b/infrastructure/cdn-in-a-box/mid/init.d/99-run.sh
@@ -61,7 +61,7 @@ while [[ -z $found ]]; do
found=$(to-get api/2.0/cdns?name="$CDN_NAME" | jq -r '.response[].name')
done
-hostname="$(hostname)"
+hostname="$(hostname --short)"
mid_index="${hostname#mid-}"
# argument 1 is server type
to-enroll mid $CDN_NAME "CDN_in_a_Box_Mid-${mid_index}" || (while true; do
echo "enroll failed."; sleep 3 ; done)