From ace111401306725cb3acb13179b435b01144707d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 23 Nov 2015 16:30:31 +0000 Subject: [PATCH] Don't initially change network settings for generic image --- src/freedombone-image-customise | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/freedombone-image-customise b/src/freedombone-image-customise index f08f3e03..15eae3a2 100755 --- a/src/freedombone-image-customise +++ b/src/freedombone-image-customise @@ -97,7 +97,8 @@ EOF } configure_networking() { - echo "# This file describes the network interfaces available on your system + 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). # The loopback network interface @@ -133,14 +134,15 @@ iface eth0 inet static # network 192.168.7.0 # gateway 192.168.7.1" > $rootdir/etc/network/interfaces - hexarray=( 1 2 3 4 5 6 7 8 9 0 a b c d e f ) - a=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]} - b=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]} - c=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]} - d=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]} - 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 + hexarray=( 1 2 3 4 5 6 7 8 9 0 a b c d e f ) + a=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]} + b=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]} + c=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]} + d=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]} + 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