Skip to content

Instantly share code, notes, and snippets.

@pdt256
Created June 6, 2012 19:37
Show Gist options
  • Save pdt256/2884166 to your computer and use it in GitHub Desktop.
Save pdt256/2884166 to your computer and use it in GitHub Desktop.
Wait for AWS instance and MySQL service to start in Bash
#!/bin/bash
echo -n "Waiting for MySQL to start."
while :; do
ssh 10.0.0.5 "mysql -e 'select @@hostname'" &> /dev/null
[ $? -eq 0 ] && break
echo -n '.'
sleep 5
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment