Created
May 18, 2015 13:09
-
-
Save sitano/d147496436d688fccc50 to your computer and use it in GitHub Desktop.
Consul 0.4.x startup WAN reconnect script
This file contains 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 | |
. /etc/environment | |
PUBLIC_IPV4=`cat /etc/network/interfaces | grep -A 2 'iface eth0' | head -n +2 | tail -n 1 | awk '{print $2}'` | |
PRIVATE_IPV4=`cat /etc/network/interfaces | grep -A 2 'iface eth1' | head -n +2 | tail -n 1 | awk '{print $2}'` | |
SERVERS=(DATACENTER1 DATACENTER2 DATACENTER3) | |
for SERVER in "${SERVERS[@]}"; do | |
curl http://${PRIVATE_IPV4}:8500/v1/agent/join/${SERVER}.mysupercompany.com:8302?wan=1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment