Skip to content

Instantly share code, notes, and snippets.

@thinkspill
Created May 19, 2017 00:07
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 thinkspill/92a78f831bb52a19f3157aa24ce4e412 to your computer and use it in GitHub Desktop.
Save thinkspill/92a78f831bb52a19f3157aa24ce4e412 to your computer and use it in GitHub Desktop.
waitForSql
#!/usr/bin/env bash
slowFortune() {
/usr/games/fortune -l > ./fortune && while ! sqlIsListening && read line; do echo $line; sleep 1 ; done < ./fortune
printf "\n~ fin...? ~\n\n"
}
sqlIsListening() {
return `lsof -i | grep LISTEN | grep -qs sqlservr; echo $?`
}
while ! sqlIsListening; do slowFortune; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment