This is an automated email from the ASF dual-hosted git repository.

ocket8888 pushed a commit to branch 5.0.x
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git

commit 02612bb80e4a06ad2d6ac5c6043c42886d2aaae2
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.
    
    (cherry picked from commit b0deb7d6755e3624bdbe7bb1e3844559b869f879)
---
 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)

Reply via email to