Don't initially change network settings for generic image
This commit is contained in:
parent
4202582083
commit
ace1114013
|
@ -97,7 +97,8 @@ EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
configure_networking() {
|
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).
|
# and how to activate them. For more information, see interfaces(5).
|
||||||
|
|
||||||
# The loopback network interface
|
# The loopback network interface
|
||||||
|
@ -133,14 +134,15 @@ iface eth0 inet static
|
||||||
# network 192.168.7.0
|
# network 192.168.7.0
|
||||||
# gateway 192.168.7.1" > $rootdir/etc/network/interfaces
|
# 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 )
|
hexarray=( 1 2 3 4 5 6 7 8 9 0 a b c d e f )
|
||||||
a=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]}
|
a=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]}
|
||||||
b=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]}
|
b=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]}
|
||||||
c=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]}
|
c=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]}
|
||||||
d=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]}
|
d=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]}
|
||||||
e=${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" \
|
sed -i "s|#hwaddress ether.*|hwaddress ether de:$a:$b:$c:$d:$e|g" \
|
||||||
$rootdir/etc/network/interfaces
|
$rootdir/etc/network/interfaces
|
||||||
|
fi
|
||||||
|
|
||||||
sed -i "s/nameserver.*/nameserver $NAMESERVER1/g" $rootdir/etc/resolv.conf
|
sed -i "s/nameserver.*/nameserver $NAMESERVER1/g" $rootdir/etc/resolv.conf
|
||||||
sed -i "/nameserver $NAMESERVER1/a\nameserver $NAMESERVER2" $rootdir/etc/resolv.conf
|
sed -i "/nameserver $NAMESERVER1/a\nameserver $NAMESERVER2" $rootdir/etc/resolv.conf
|
||||||
|
|
Loading…
Reference in New Issue