modified the way it looks for network interfaces to handle docker swarm

This commit is contained in:
antitree
2017-07-08 19:50:00 -04:00
parent 53609ddd8d
commit 8c9843eb1a

View File

@@ -18,7 +18,10 @@ if [ ! -e /tor-config-done ]; then
# Host specific modifications to the torrc file
echo -e "DataDirectory ${TOR_DIR}/${TOR_NICKNAME}" >> /etc/tor/torrc
TOR_IP=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
# Updated to handle docker stack/swarm network overlays
TOR_IP=$(ip addr show eth1 | grep "inet" | grep -v '\/32'| awk '{print $2}' | cut -f1 -d'/')
NICS=$(ip addr | grep 'state UP' | awk '{print $2}' | cut -f1 -d':')
if
echo "Address ${TOR_IP}" >> /etc/tor/torrc
echo -e "ControlPort 0.0.0.0:9051" >> /etc/tor/torrc
if [ -z "${TOR_CONTROL_PWD}" ]; then