0b86194216
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
24 lines
564 B
Bash
Executable file
24 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
|