netcardconfig: use 'udevadm info' instead of 'udevinfo' v0.2.8
authorMichael Prokop <mika@grml.org>
Mon, 15 Jun 2009 22:41:55 +0000 (00:41 +0200)
committerMichael Prokop <mika@grml.org>
Mon, 15 Jun 2009 22:41:55 +0000 (00:41 +0200)
debian/changelog
sbin/netcardconfig

index e94d14f..dbdfb9e 100644 (file)
@@ -1,3 +1,10 @@
+grml-network (0.2.8) unstable; urgency=low
+
+  * netcardconfig: use 'udevadm info' instead of 'udevinfo' if
+    available as udevinfo will disappear from udev.
+
+ -- Michael Prokop <mika@grml.org>  Tue, 16 Jun 2009 00:40:52 +0200
+
 grml-network (0.2.7) unstable; urgency=low
 
   * grml-bridge: bring network devices up by default using
index ad76a5f..9312052 100755 (executable)
@@ -4,7 +4,6 @@
 # Authors:       Michael Prokop <mika@grml.org>, Marcel Wichern 2006, Klaus Knopper 2002, Niall Walsh + Stefan Lippers-Hollmann 2004-2007
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2.
-# Latest change: Mit Mai 30 10:26:39 CEST 2007 [mika]
 ################################################################################
 # Changes have been merged from Kanotix's and Sidux's netcardconfig:
 # http://kanotix.com/files/debian/pool/main/n/netcardconfig-kanotix/
@@ -91,7 +90,11 @@ generate_udev_entry() {
 # running this script (once more)." > /etc/udev/scripts/netcardconfig
   for interface in `ifconfig | awk '/^[a-z]/ &&!/^lo/{ print $1} '` ; do
       echo -n "INTERFACE=$interface /lib/udev/write_net_rules " >> /etc/udev/scripts/netcardconfig && \
-      udevinfo -a -p /sys/class/net/$interface | awk -F'==' '/address/ {print $2}' >> /etc/udev/scripts/netcardconfig
+      if which udevadm >/dev/null 2>&1; then
+        udevadm info -a -p /sys/class/net/$interface | awk -F'==' '/address/ {print $2}' >> /etc/udev/scripts/netcardconfig
+      else
+        udevinfo -a -p /sys/class/net/$interface | awk -F'==' '/address/ {print $2}' >> /etc/udev/scripts/netcardconfig
+      fi
   done
   # send errors to /dev/null as well because the sed line inside the /lib/udev/write_net_rules
   # script outputs a sed warning which might unsettle users