3cb4273590
We are currently removing only eth0 network config in the simple-init element (since simple-init is responsible for networking if you are using it). We install an eth1 as well in elements such as debootstrap. Lets just rm eth*. Change-Id: Id9ea8c5e402f3a06b9064a939ad4b2e168cd6223
31 lines
648 B
Bash
Executable File
31 lines
648 B
Bash
Executable File
#!/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
|
|
rm -f /etc/sysconfig/network-scripts/ifcfg-eth*
|
|
|
|
# Ubuntu
|
|
rm -f /etc/network/interfaces.d/eth*
|
|
|
|
# Debian
|
|
rm -f /etc/network/interfaces.d/eth*
|
|
|
|
# Gentoo
|
|
rm -f /etc/conf.d/net*
|
|
|
|
# /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
|