diff --git a/compute/src/test/resources/initscript_with_java.sh b/compute/src/test/resources/initscript_with_java.sh index 17982edb18..b52d6f9363 100644 --- a/compute/src/test/resources/initscript_with_java.sh +++ b/compute/src/test/resources/initscript_with_java.sh @@ -115,7 +115,10 @@ function ensure_netutils_yum() { # most network services require that the hostname is in # the /etc/hosts file, or they won't operate function ensure_hostname_in_hosts() { - egrep -q `hostname` /etc/hosts || awk -v hostname=`hostname` 'END { print $1" "hostname }' /proc/net/arp >> /etc/hosts + # NOTE: + # 1. We blindly trust existing hostname settings in /etc/hosts + # 2. We assume hostname supports the -i option to return the default NICs IP address + egrep -q `hostname` /etc/hosts || echo "`hostname -i` `hostname`" >> /etc/hosts } # download locations for many services are at public dns diff --git a/compute/src/test/resources/initscript_with_jetty.sh b/compute/src/test/resources/initscript_with_jetty.sh index 4f0227dd4f..52609f33cd 100644 --- a/compute/src/test/resources/initscript_with_jetty.sh +++ b/compute/src/test/resources/initscript_with_jetty.sh @@ -115,7 +115,10 @@ function ensure_netutils_yum() { # most network services require that the hostname is in # the /etc/hosts file, or they won't operate function ensure_hostname_in_hosts() { - egrep -q `hostname` /etc/hosts || awk -v hostname=`hostname` 'END { print $1" "hostname }' /proc/net/arp >> /etc/hosts + # NOTE: + # 1. We blindly trust existing hostname settings in /etc/hosts + # 2. We assume hostname supports the -i option to return the default NICs IP address + egrep -q `hostname` /etc/hosts || echo "`hostname -i` `hostname`" >> /etc/hosts } # download locations for many services are at public dns diff --git a/compute/src/test/resources/runscript.sh b/compute/src/test/resources/runscript.sh index 652feded31..aaa38777f3 100644 --- a/compute/src/test/resources/runscript.sh +++ b/compute/src/test/resources/runscript.sh @@ -115,7 +115,10 @@ function ensure_netutils_yum() { # most network services require that the hostname is in # the /etc/hosts file, or they won't operate function ensure_hostname_in_hosts() { - egrep -q `hostname` /etc/hosts || awk -v hostname=`hostname` 'END { print $1" "hostname }' /proc/net/arp >> /etc/hosts + # NOTE: + # 1. We blindly trust existing hostname settings in /etc/hosts + # 2. We assume hostname supports the -i option to return the default NICs IP address + egrep -q `hostname` /etc/hosts || echo "`hostname -i` `hostname`" >> /etc/hosts } # download locations for many services are at public dns diff --git a/labs/virtualbox/src/test/resources/test_guest_additions_installer_init.sh b/labs/virtualbox/src/test/resources/test_guest_additions_installer_init.sh index 2d6320ed4c..58a9a7c959 100644 --- a/labs/virtualbox/src/test/resources/test_guest_additions_installer_init.sh +++ b/labs/virtualbox/src/test/resources/test_guest_additions_installer_init.sh @@ -112,7 +112,10 @@ function ensure_netutils_yum() { # most network services require that the hostname is in # the /etc/hosts file, or they won't operate function ensure_hostname_in_hosts() { - egrep -q `hostname` /etc/hosts || awk -v hostname=`hostname` 'END { print $1" "hostname }' /proc/net/arp >> /etc/hosts + # NOTE: + # 1. We blindly trust existing hostname settings in /etc/hosts + # 2. We assume hostname supports the -i option to return the default NICs IP address + egrep -q `hostname` /etc/hosts || echo "`hostname -i` `hostname`" >> /etc/hosts } # download locations for many services are at public dns diff --git a/scriptbuilder/src/main/resources/functions/setupPublicCurl.sh b/scriptbuilder/src/main/resources/functions/setupPublicCurl.sh index eb7cdd9861..a59dd627d4 100644 --- a/scriptbuilder/src/main/resources/functions/setupPublicCurl.sh +++ b/scriptbuilder/src/main/resources/functions/setupPublicCurl.sh @@ -30,7 +30,10 @@ function ensure_netutils_yum() { # most network services require that the hostname is in # the /etc/hosts file, or they won't operate function ensure_hostname_in_hosts() { - egrep -q `hostname` /etc/hosts || awk -v hostname=`hostname` 'END { print $1" "hostname }' /proc/net/arp >> /etc/hosts + # NOTE: + # 1. We blindly trust existing hostname settings in /etc/hosts + # 2. We assume hostname supports the -i option to return the default NICs IP address + egrep -q `hostname` /etc/hosts || echo "`hostname -i` `hostname`" >> /etc/hosts } # download locations for many services are at public dns diff --git a/scriptbuilder/src/test/resources/test_install_chef_gems_scriptbuilder.sh b/scriptbuilder/src/test/resources/test_install_chef_gems_scriptbuilder.sh index 5235bae171..3d99dea2b0 100644 --- a/scriptbuilder/src/test/resources/test_install_chef_gems_scriptbuilder.sh +++ b/scriptbuilder/src/test/resources/test_install_chef_gems_scriptbuilder.sh @@ -115,7 +115,10 @@ function ensure_netutils_yum() { # most network services require that the hostname is in # the /etc/hosts file, or they won't operate function ensure_hostname_in_hosts() { - egrep -q `hostname` /etc/hosts || awk -v hostname=`hostname` 'END { print $1" "hostname }' /proc/net/arp >> /etc/hosts + # NOTE: + # 1. We blindly trust existing hostname settings in /etc/hosts + # 2. We assume hostname supports the -i option to return the default NICs IP address + egrep -q `hostname` /etc/hosts || echo "`hostname -i` `hostname`" >> /etc/hosts } # download locations for many services are at public dns diff --git a/scriptbuilder/src/test/resources/test_install_git_scriptbuilder.sh b/scriptbuilder/src/test/resources/test_install_git_scriptbuilder.sh index b876867c6c..08533043b7 100644 --- a/scriptbuilder/src/test/resources/test_install_git_scriptbuilder.sh +++ b/scriptbuilder/src/test/resources/test_install_git_scriptbuilder.sh @@ -115,7 +115,10 @@ function ensure_netutils_yum() { # most network services require that the hostname is in # the /etc/hosts file, or they won't operate function ensure_hostname_in_hosts() { - egrep -q `hostname` /etc/hosts || awk -v hostname=`hostname` 'END { print $1" "hostname }' /proc/net/arp >> /etc/hosts + # NOTE: + # 1. We blindly trust existing hostname settings in /etc/hosts + # 2. We assume hostname supports the -i option to return the default NICs IP address + egrep -q `hostname` /etc/hosts || echo "`hostname -i` `hostname`" >> /etc/hosts } # download locations for many services are at public dns diff --git a/scriptbuilder/src/test/resources/test_install_jdk_scriptbuilder.sh b/scriptbuilder/src/test/resources/test_install_jdk_scriptbuilder.sh index 905aef3de4..ab8210beff 100644 --- a/scriptbuilder/src/test/resources/test_install_jdk_scriptbuilder.sh +++ b/scriptbuilder/src/test/resources/test_install_jdk_scriptbuilder.sh @@ -115,7 +115,10 @@ function ensure_netutils_yum() { # most network services require that the hostname is in # the /etc/hosts file, or they won't operate function ensure_hostname_in_hosts() { - egrep -q `hostname` /etc/hosts || awk -v hostname=`hostname` 'END { print $1" "hostname }' /proc/net/arp >> /etc/hosts + # NOTE: + # 1. We blindly trust existing hostname settings in /etc/hosts + # 2. We assume hostname supports the -i option to return the default NICs IP address + egrep -q `hostname` /etc/hosts || echo "`hostname -i` `hostname`" >> /etc/hosts } # download locations for many services are at public dns diff --git a/scriptbuilder/src/test/resources/test_install_ruby_scriptbuilder.sh b/scriptbuilder/src/test/resources/test_install_ruby_scriptbuilder.sh index bb24b39fe3..6ce3c90633 100644 --- a/scriptbuilder/src/test/resources/test_install_ruby_scriptbuilder.sh +++ b/scriptbuilder/src/test/resources/test_install_ruby_scriptbuilder.sh @@ -115,7 +115,10 @@ function ensure_netutils_yum() { # most network services require that the hostname is in # the /etc/hosts file, or they won't operate function ensure_hostname_in_hosts() { - egrep -q `hostname` /etc/hosts || awk -v hostname=`hostname` 'END { print $1" "hostname }' /proc/net/arp >> /etc/hosts + # NOTE: + # 1. We blindly trust existing hostname settings in /etc/hosts + # 2. We assume hostname supports the -i option to return the default NICs IP address + egrep -q `hostname` /etc/hosts || echo "`hostname -i` `hostname`" >> /etc/hosts } # download locations for many services are at public dns