Skip to content

Commit

Permalink
tested and adapted for Hetzner, DigitalOcean (IPv6) and Linode (IPv4 …
Browse files Browse the repository at this point in the history
…only) now, mini-fix
  • Loading branch information
marsmensch committed Feb 2, 2018
1 parent 19a106c commit f8e6b7c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -593,11 +593,16 @@ function prepare_mn_interfaces() {
echo "Default interface is down, fallback didn't work. Break here."
exit 1
fi

# DO ipv6 fix, are we on DO?
if [[ -z $(grep --quiet "::8888" ${DO_NET_CONF}) ]] && [[ -f ${DO_NET_CONF} ]]; then
sed -i '/iface eth0 inet6 static/a dns-nameservers 2001:4860:4860::8844 2001:4860:4860::8888 8.8.8.8 127.0.0.1' ${DO_NET_CONF}
ifdown ${ETH_INTERFACE}; ifup ${ETH_INTERFACE};

# DO ipv6 fix, are we on DO?
# check for DO network config file
if [ -f ${DO_NET_CONF} ]; then
# found the DO config
if ! grep -q "::8888" ${DO_NET_CONF}; then
echo "ipv6 fix not found, applying!"
sed -i '/iface eth0 inet6 static/a dns-nameservers 2001:4860:4860::8844 2001:4860:4860::8888 8.8.8.8 127.0.0.1' ${DO_NET_CONF}
ifdown ${ETH_INTERFACE}; ifup ${ETH_INTERFACE};
fi
fi

IPV6_INT_BASE="$(ip -6 addr show dev ${ETH_INTERFACE} | grep inet6 | awk -F '[ \t]+|/' '{print $3}' | grep -v ^fe80 | grep -v ^::1 | cut -f1-4 -d':' | head -1)" &>> ${SCRIPT_LOGFILE}
Expand Down

0 comments on commit f8e6b7c

Please sign in to comment.