Adding live-initramfs 1.87.1-1.
[live-boot-grml.git] / scripts / casper-bottom / 23networking
index 129ca35..1b732d3 100755 (executable)
@@ -21,7 +21,7 @@ esac
 
 log_begin_msg "$DESCRIPTION"
 
-if [ "${STATICIP}" == "frommedia" -a -e  "$IFFILE" ] ; then
+if [ "${STATICIP}" = "frommedia" -a -e  "$IFFILE" ] ; then
     # will use existent /etc/network/interfaces
     log_end_msg
     exit 0
@@ -34,6 +34,7 @@ iface lo inet loopback
 EOF
 
 udevtrigger
+udevsettle
 
 if [ -z "${NETBOOT}" -a -n "${STATICIP}" -a "${STATICIP}" != "frommedia" ]; then
     parsed=$(echo "${STATICIP}" | sed -e 's/:/ /g')
@@ -60,14 +61,13 @@ else
         # on startup by ifup script - otherwise our root fs might be disconnected!
         method="manual"
     fi
-
     # iterate the physical interfaces and add them to the interfaces list
     for interface in /sys/class/net/eth* /sys/class/net/ath* /sys/class/net/wlan*; do
         [ -e $interface ] || continue
         i="$(basename $interface)"
         cat >> "$IFFILE" <<EOF
-auto ${i}
-iface ${i} inet ${method}
+auto $i
+iface $i inet $method
 
 EOF
     done
@@ -95,4 +95,13 @@ EOF
     fi
 fi
 
+for i in eth0 eth1 eth2 ath0 wlan0; do
+    grep -q "iface $i" $IFFILE && continue
+    cat >> "$IFFILE" <<EOF
+auto $i
+iface $i inet dhcp
+
+EOF
+done
+
 log_end_msg