diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-05-17 16:51:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-17 16:51:25 -0400 |
commit | d103ed6ca97ca5a2669f6cf5fe4b3d2a9c945f26 (patch) | |
tree | dbde13123c6add150448f7b75753ac022d862475 /vendor/github.com/hashicorp/memberlist/test/setup_subnet.sh | |
parent | cd23b8139a9463b67e3096744321f6f4eb0ca40a (diff) | |
download | chat-d103ed6ca97ca5a2669f6cf5fe4b3d2a9c945f26.tar.gz chat-d103ed6ca97ca5a2669f6cf5fe4b3d2a9c945f26.tar.bz2 chat-d103ed6ca97ca5a2669f6cf5fe4b3d2a9c945f26.zip |
Upgrading server dependancies (#6431)
Diffstat (limited to 'vendor/github.com/hashicorp/memberlist/test/setup_subnet.sh')
-rwxr-xr-x | vendor/github.com/hashicorp/memberlist/test/setup_subnet.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/memberlist/test/setup_subnet.sh b/vendor/github.com/hashicorp/memberlist/test/setup_subnet.sh new file mode 100755 index 000000000..6651c8ce4 --- /dev/null +++ b/vendor/github.com/hashicorp/memberlist/test/setup_subnet.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# +# This script makes sure that 127.0.0.x is routable. On Darwin, there +# is a bug that it isn't routable and this causes errors. +# + +# Check if loopback is setup +ping -c 1 -W 10 127.0.0.2 > /dev/null 2>&1 +if [ $? -eq 0 ] +then + exit +fi + +# If we're not on OS X, then error +case $OSTYPE in + darwin*) + ;; + *) + echo "Can't setup interfaces on non-Mac. Error!" + exit 1 + ;; +esac + +# Setup loopback +for ((i=2;i<256;i++)) +do + sudo ifconfig lo0 alias 127.0.0.$i up +done |