Skip to content

Commit

Permalink
Merge pull request #89 from chaen/more_run_demo_ip
Browse files Browse the repository at this point in the history
run_demo: force IPv4 and typo
  • Loading branch information
chaen authored Apr 9, 2024
2 parents bc3baa0 + 2d2e32f commit a39f7d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions run_demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function space_monitor(){
function check_hostname(){
# Check that the hostname resolves to an IP address
# dig doesn't consider the effect of /etc/hosts so we use ping instead
if ! ip_address=$(ping -c 1 "$1" | grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' | head -n 1); then
if ! ip_address=$(ping -4 -c 1 "$1" | grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' | head -n 1); then
printf "%b ping command exited with a non-zero exit code\n" ${SKULL_EMOJI}
return 1
fi
Expand Down Expand Up @@ -372,7 +372,7 @@ if ! check_hostname "${machine_hostname}"; then
machine_ip=$(ifconfig | grep 'inet ' | awk '{ print $2 }' | grep -v '^127' | head -n 1 | cut -d '/' -f 1)
# We use nip.io to have an actual DNS name and be allowed to specify this in
# the ingress host
machine_hostname="${machine_hostname}.nip.io"
machine_hostname="${machine_ip}.nip.io"
if ! check_hostname "${machine_hostname}"; then
echo "Failed to find an appropriate hostname for the demo."
exit 1
Expand Down

0 comments on commit a39f7d1

Please sign in to comment.