瀏覽代碼

Don't initially change network settings for generic image

Bob Mottram 9 年之前
父節點
當前提交
ace1114013
共有 1 個檔案被更改,包括 11 行新增9 行删除
  1. 11
    9
      src/freedombone-image-customise

+ 11
- 9
src/freedombone-image-customise 查看文件

@@ -97,7 +97,8 @@ EOF
97 97
 }
98 98
 
99 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 102
 # and how to activate them. For more information, see interfaces(5).
102 103
 
103 104
 # The loopback network interface
@@ -133,14 +134,15 @@ iface eth0 inet static
133 134
 #    network 192.168.7.0
134 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 147
     sed -i "s/nameserver.*/nameserver $NAMESERVER1/g" $rootdir/etc/resolv.conf
146 148
     sed -i "/nameserver $NAMESERVER1/a\nameserver $NAMESERVER2" $rootdir/etc/resolv.conf