Rewrote interfaces() code for handling of /etc/network/interfaces.
authorMichael Prokop <mika@grml.org>
Sat, 28 Apr 2007 16:58:58 +0000 (18:58 +0200)
committerMichael Prokop <mika@grml.org>
Sat, 28 Apr 2007 16:58:58 +0000 (18:58 +0200)
chroot-script
debian/changelog

index bc93353..9e1437f 100644 (file)
@@ -270,13 +270,20 @@ hosts() {
 
 # set up /etc/network/interfaces {{{
 interfaces() {
-  if ! [ -f /etc/network/interfaces ] ; then
+  touch /etc/network/interfaces
+  # make sure we add the entries only once
+  if ! grep -q eth0 /etc/network/interfaces ; then
      echo "Setting up /etc/network/interfaces"
      cat >> /etc/network/interfaces << EOF
+
+# loopback device:
 iface lo inet loopback
-iface eth0 inet dhcp
 auto lo
-auto eth0
+
+# eth0:
+# iface eth0 inet dhcp
+# auto eth0
+
 EOF
   fi
 }
index 7f16013..cbe968c 100644 (file)
@@ -11,6 +11,8 @@ grml-debootstrap (0.9) unstable; urgency=low
     via GRMLREPOS and GRMLPACKAGES.
   * Use stage logic inside chroot-script as well.
   * Activate zsh completion.
+  * Rewrote interfaces() code for handling of
+    /etc/network/interfaces. Thanks for the pointer, formorer.
 
  -- Michael Prokop <mika@grml.org>  Mon, 23 Apr 2007 00:23:19 +0200