diskimage-builder/elements/dhcp-all-interfaces/install.d/60-remove-cloud-image-interfaces
Ghe Rivero 0b86194216 Disable all interfaces on eni systems
We are autodetecting and configuring devices in dhcp-all-interfaces
so having one configured in /etc/network/interfaces by default
is redundant and slows boot down.

Change-Id: Ic4e8a0668c793d21ed2dd96908649c9a77264f67
Closes-Bug: #1239480
2014-10-16 12:27:22 +00:00

25 lines
564 B
Bash
Executable File

#!/bin/bash
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-eth0
# Ubuntu
rm -f /etc/network/interfaces.d/eth0.cfg
# Debian
rm -f /etc/network/interfaces.d/eth0
# /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