diff --git a/elements/debootstrap/install.d/10-debian-networking b/elements/debootstrap/install.d/10-debian-networking index 7e85cbe57..d5cdc1400 100755 --- a/elements/debootstrap/install.d/10-debian-networking +++ b/elements/debootstrap/install.d/10-debian-networking @@ -26,7 +26,10 @@ echo $DISTRO_NAME > /etc/hostname # cloud images expect eth0 and eth1 to use dhcp. mkdir -p /etc/network/interfaces.d -echo "source /etc/network/interfaces.d/*" >> /etc/network/interfaces +if ! grep -E -q '^source(|-directory) /etc/network/interfaces.d/\*' /etc/network/interfaces; then + echo "source /etc/network/interfaces.d/*" >> /etc/network/interfaces + echo 'Network configuration set to source /etc/network/interfaces.d/*' +fi for interface in eth0 eth1; do cat << EOF | tee /etc/network/interfaces.d/$interface auto $interface