Skip to content

Instantly share code, notes, and snippets.

@tomdavidson
Created June 16, 2015 20:52
Show Gist options
  • Save tomdavidson/3ba6b085a117d81a52d3 to your computer and use it in GitHub Desktop.
Save tomdavidson/3ba6b085a117d81a52d3 to your computer and use it in GitHub Desktop.
database load script to use with docker, waits for db server to reply to ping.
#!/bin/bash
tar -xvf /tmp/build-data/sandbox_sql.tar.gz -C /tmp/build-data
while ! ping -c1 expressionengine &>/dev/null; do sleep 2; echo "waiting on expressionengine"; done
mysql -hexpressionengine -uroot -proot sandbox_expressionengine < /tmp/build-data/sandbox_expressionengine.sql
while ! ping -c1 wowzalicensing &>/dev/null; do sleep 2; echo "waiting on wowzalicensing"; done
mysql -hwowzalicensing -uroot -proot sandbox_wowzalicensing < /tmp/build-data/sandbox_wowzalicensing.sql
while ! ping -c1 wowzamedia &>/dev/null; do sleep 2; echo "waiting on wowzamedia"; done
mysql -hwowzamedia -uroot -proot sandbox_wowzamedia < /tmp/build-data/sandbox_wowzamedia.sql
rm /tmp/build-data/*.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment