2014-04-11 18:16:10 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2014-09-04 04:56:29 +00:00
|
|
|
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
2014-03-29 03:28:22 +00:00
|
|
|
set -eu
|
|
|
|
set -o pipefail
|
|
|
|
|
2014-04-11 18:16:10 +00:00
|
|
|
# Cloud images may hard code the eth0 interfaces so they
|
2014-04-17 03:45:46 +00:00
|
|
|
# boot with DHCP.
|
2014-04-11 18:16:10 +00:00
|
|
|
|
|
|
|
# Fedora
|
2014-04-17 03:45:46 +00:00
|
|
|
rm -f /etc/sysconfig/network-scripts/ifcfg-eth0
|
2014-04-11 18:16:10 +00:00
|
|
|
|
|
|
|
# Ubuntu
|
2014-04-17 03:45:46 +00:00
|
|
|
rm -f /etc/network/interfaces.d/eth0.cfg
|
|
|
|
|
|
|
|
# Debian
|
|
|
|
rm -f /etc/network/interfaces.d/eth0
|
2014-10-09 12:33:01 +00:00
|
|
|
|
|
|
|
# /etc/network/interfaces distributions
|
|
|
|
if [ -f "/etc/network/interfaces" ]; then
|
|
|
|
printf "auto lo\niface lo inet loopback\n\n" > /etc/network/interfaces
|
|
|
|
if [ -d "/etc/network/interfaces.d/" ]; then
|
|
|
|
printf "source-directory interfaces.d\n\n" >> /etc/network/interfaces
|
|
|
|
fi
|
|
|
|
fi
|