Rewrote interfaces() code for handling of /etc/network/interfaces.
[grml-debootstrap.git] / chroot-script
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
 }