Created
February 13, 2014 08:06
-
-
Save reorx/8971484 to your computer and use it in GitHub Desktop.
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
| #!/bin/bash | |
| #wait for internet connection up to 15 seconds | |
| host=baidu.com | |
| CONNECTED=$(ping -w5 -c1 $host > /dev/null 2>&1 && echo "up" || echo "down") | |
| STOPWATCH=0 | |
| while [ "$CONNECTED" = "down" ] && [ $STOPWATCH -lt 15 ]; do | |
| sleep 1; | |
| CONNECTED=$(ping -w5 -c1 $host > /dev/null 2>&1 && echo "up" || echo "down") | |
| let STOPWATCH++ | |
| done | |
| #run Thunderbird | |
| thunderbird & | |
| #Search for Thunderbird window | |
| TB=$(xdotool search --class thunderbird) | |
| while [ -z "$TB" ]; do | |
| sleep 10 #Adjust this to your system needs | |
| TB=$(xdotool search --class thunderbird) | |
| done | |
| #dispose Thunderbird window | |
| xdotool search --class thunderbird windowunmap %@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment