Created
May 19, 2017 00:07
-
-
Save thinkspill/92a78f831bb52a19f3157aa24ce4e412 to your computer and use it in GitHub Desktop.
waitForSql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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