Skip to content

Instantly share code, notes, and snippets.

@lcherone
Last active April 6, 2018 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lcherone/26ac81257f275f2d05bea62509b3eaef to your computer and use it in GitHub Desktop.
Save lcherone/26ac81257f275f2d05bea62509b3eaef to your computer and use it in GitHub Desktop.
Linux wait for network connection before continuing. Docker, LXC, containers, cloud-init
#/bin/bash
echo "Waiting for network connection."
while [ 1 ]; do
if ping -q -c 1 -W 1 8.8.8.8 > /dev/null 2>&1; then
break;
fi
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment