Created
April 4, 2015 21:18
-
-
Save jacoelho/27df0d14e221625f5455 to your computer and use it in GitHub Desktop.
boot2docker route
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 | |
if [[ 'running' != $(boot2docker status) ]]; then | |
echo "boot2docker not running" | |
exit 1 | |
fi | |
BOOT2DOCKER_IP=$(boot2docker ip) | |
BOOT2DOCKER_NETWORK=$(boot2docker ssh "ip route show" | awk '/docker0/{print $1}') | |
sudo bash <<EOF | |
route -n delete "${BOOT2DOCKER_NETWORK}" "${BOOT2DOCKER_IP}" || true | |
route -n add "${BOOT2DOCKER_NETWORK}" "${BOOT2DOCKER_IP}" | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment