diskimage-builder/elements/simple-init/install.d/60-simple-init-remove-interfaces
Gregory Haynes 3cb4273590 Remove all interface configs for simple-init
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
2016-03-19 04:17:34 +00:00

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