Don't initially change network settings for generic image

This commit is contained in:
Bob Mottram 2015-11-23 16:30:31 +00:00
parent 4202582083
commit ace1114013
1 changed files with 11 additions and 9 deletions

View File

@ -97,6 +97,7 @@ EOF
}
configure_networking() {
if [[ $GENERIC_IMAGE == "no" ]]; then
echo "# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
@ -141,6 +142,7 @@ iface eth0 inet static
e=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]}
sed -i "s|#hwaddress ether.*|hwaddress ether de:$a:$b:$c:$d:$e|g" \
$rootdir/etc/network/interfaces
fi
sed -i "s/nameserver.*/nameserver $NAMESERVER1/g" $rootdir/etc/resolv.conf
sed -i "/nameserver $NAMESERVER1/a\nameserver $NAMESERVER2" $rootdir/etc/resolv.conf