diskimage-builder/elements/simple-init/install.d/60-simple-init-remove-interfaces
Markos Chandras 89c708ce61 elements: simple-init: Remove SUSE interfaces
Make sure SUSE interfaces are removed as well.

Change-Id: If993dc606217f2ec243392ac2fa588ebae1cce86
2016-10-18 19:02:41 +01:00

34 lines
696 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*
# SUSE
rm -f /etc/sysconfig/network/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