Do not generate dhcp entry for loopback interface
authorMichael Prokop <mika@grml.org>
Fri, 8 Feb 2019 15:26:21 +0000 (16:26 +0100)
committerMichael Prokop <mika@grml.org>
Fri, 8 Feb 2019 15:26:21 +0000 (16:26 +0100)
This fixes a regression that was introduced in commit 52474b4c28303324.
The variable $interface is pointing towards /sys/class/net/lo,
at least until we overwrite the variable by the basename of
its network interface name path. Accordingly fix order for comparison.

Closes: https://github.com/grml/live-boot-grml/issues/9
Thanks: Mykola Malkov for the bug report

components/9990-grml-networking.sh

index ace078e..16e7b7f 100644 (file)
@@ -51,8 +51,8 @@ unset HOSTNAME
 # generate config for each present network device
 for interface in /sys/class/net/* ; do
     [ -e ${interface} ] || continue
-    [ "${interface}" = "lo" ] && continue
     interface=$(basename ${interface})
+    [ "${interface}" = "lo" ] && continue
     method="dhcp"
 
     # NODHCP or a previously run ipconfig mean that ifupdown should never