2015-03-23 20:48:51 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
|
|
|
set -eu
|
|
|
|
set -o pipefail
|
|
|
|
|
|
|
|
# Cloud images may hard code the eth0 interfaces so they
|
|
|
|
# boot with DHCP.
|
|
|
|
|
|
|
|
# Fedora
|
2016-03-19 04:17:34 +00:00
|
|
|
rm -f /etc/sysconfig/network-scripts/ifcfg-eth*
|
2015-03-23 20:48:51 +00:00
|
|
|
|
2016-10-18 18:02:41 +00:00
|
|
|
# SUSE
|
|
|
|
rm -f /etc/sysconfig/network/ifcfg-eth*
|
|
|
|
|
2015-03-23 20:48:51 +00:00
|
|
|
# Ubuntu
|
2016-03-19 04:17:34 +00:00
|
|
|
rm -f /etc/network/interfaces.d/eth*
|
2015-03-23 20:48:51 +00:00
|
|
|
|
|
|
|
# Debian
|
2016-03-19 04:17:34 +00:00
|
|
|
rm -f /etc/network/interfaces.d/eth*
|
2015-03-23 20:48:51 +00:00
|
|
|
|
2016-01-28 22:14:24 +00:00
|
|
|
# Gentoo
|
|
|
|
rm -f /etc/conf.d/net*
|
|
|
|
|
2015-03-23 20:48:51 +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
|
2018-04-19 10:00:13 +00:00
|
|
|
if [ "$DISTRO_NAME" == "ubuntu" ] && [ "$DIB_RELEASE" == "trusty" ]; then
|
|
|
|
printf "source-directory interfaces.d\n\n" >> /etc/network/interfaces
|
|
|
|
else
|
|
|
|
printf "source /etc/network/interfaces.d/*\n\n" >> /etc/network/interfaces
|
|
|
|
fi
|
2015-03-23 20:48:51 +00:00
|
|
|
fi
|
|
|
|
fi
|