Created
May 14, 2016 17:12
-
-
Save helsont/d28c28b8ca4d02be3db1833b3f5b1b03 to your computer and use it in GitHub Desktop.
If you attempt to simultaneously ssh into the sam vagrant box from several different terminals, you will more often than not get an error message that the box is unavailable. This script sleeps for a random period of time and then executes vagrant ssh, resolving the issue.
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 | |
SLEEPTIME=$RANDOM | |
SLEEPTIME=$((SLEEPTIME%20)) | |
SLEEPTIME=$(echo "$SLEEPTIME/10" | bc -l) | |
printf "waiting..." | |
# printf "time: %f\n" "$SLEEPTIME" | |
sleep $SLEEPTIME | |
vagrant ssh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
v lit