Merge "debootstrap: avoid duplicate network configuration"

This commit is contained in:
Jenkins 2017-01-31 17:39:28 +00:00 committed by Gerrit Code Review
commit f054e5f24a

View File

@ -26,7 +26,10 @@ echo $DISTRO_NAME > /etc/hostname
# cloud images expect eth0 and eth1 to use dhcp.
mkdir -p /etc/network/interfaces.d
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