Просмотр исходного кода

Don't initially change network settings for generic image

Bob Mottram 9 лет назад
Родитель
Сommit
ace1114013
1 измененных файлов: 11 добавлений и 9 удалений
  1. 11
    9
      src/freedombone-image-customise

+ 11
- 9
src/freedombone-image-customise Просмотреть файл

97
 }
97
 }
98
 
98
 
99
 configure_networking() {
99
 configure_networking() {
100
-    echo "# This file describes the network interfaces available on your system
100
+	if [[ $GENERIC_IMAGE == "no" ]]; then
101
+        echo "# This file describes the network interfaces available on your system
101
 # and how to activate them. For more information, see interfaces(5).
102
 # and how to activate them. For more information, see interfaces(5).
102
 
103
 
103
 # The loopback network interface
104
 # The loopback network interface
133
 #    network 192.168.7.0
134
 #    network 192.168.7.0
134
 #    gateway 192.168.7.1" > $rootdir/etc/network/interfaces
135
 #    gateway 192.168.7.1" > $rootdir/etc/network/interfaces
135
 
136
 
136
-    hexarray=( 1 2 3 4 5 6 7 8 9 0 a b c d e f )
137
-    a=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]}
138
-    b=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]}
139
-    c=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]}
140
-    d=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]}
141
-    e=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]}
142
-    sed -i "s|#hwaddress ether.*|hwaddress ether de:$a:$b:$c:$d:$e|g" \
143
-        $rootdir/etc/network/interfaces
137
+        hexarray=( 1 2 3 4 5 6 7 8 9 0 a b c d e f )
138
+        a=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]}
139
+        b=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]}
140
+        c=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]}
141
+        d=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]}
142
+        e=${hexarray[$RANDOM%16]}${hexarray[$RANDOM%16]}
143
+        sed -i "s|#hwaddress ether.*|hwaddress ether de:$a:$b:$c:$d:$e|g" \ 
144
+            $rootdir/etc/network/interfaces
145
+	fi
144
 
146
 
145
     sed -i "s/nameserver.*/nameserver $NAMESERVER1/g" $rootdir/etc/resolv.conf
147
     sed -i "s/nameserver.*/nameserver $NAMESERVER1/g" $rootdir/etc/resolv.conf
146
     sed -i "/nameserver $NAMESERVER1/a\nameserver $NAMESERVER2" $rootdir/etc/resolv.conf
148
     sed -i "/nameserver $NAMESERVER1/a\nameserver $NAMESERVER2" $rootdir/etc/resolv.conf