Skip to content

Instantly share code, notes, and snippets.

@helsont
Created May 14, 2016 17:12
Show Gist options
  • Save helsont/d28c28b8ca4d02be3db1833b3f5b1b03 to your computer and use it in GitHub Desktop.
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.
#!/bin/bash
SLEEPTIME=$RANDOM
SLEEPTIME=$((SLEEPTIME%20))
SLEEPTIME=$(echo "$SLEEPTIME/10" | bc -l)
printf "waiting..."
# printf "time: %f\n" "$SLEEPTIME"
sleep $SLEEPTIME
vagrant ssh
@davidlee1435
Copy link

v lit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment