From 4fa68f7160e93e2e2d0ba27a2a7c1bb072a05c8f Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 23 Aug 2016 14:18:23 +0200 Subject: [PATCH] netcardconfig: switch from `ifconfig` to `ip link` for interface parsing [Closes: issue2219] Quoting from the bug report: | ifconfig as of Debian stretch uses a different output format. | This breaks enumeration of devices in netcardconfig line 576. ifconfig isn't the state-of-the-art tool anyway, so switching to ip(8) is an excellent idea. :) Thanks: Jakob Haufe for the bugreport and patch --- sbin/netcardconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/netcardconfig b/sbin/netcardconfig index 7124b53..52a1c6a 100755 --- a/sbin/netcardconfig +++ b/sbin/netcardconfig @@ -573,7 +573,7 @@ while read dev mac; do fi #echo "Made to ${NETDEVICES[$NETDEVICESCOUNT]}" ((NETDEVICESCOUNT++)) -done < <(ifconfig -a|grep Ethernet|grep -v ^vmnet|awk '! /^\s/{print $1" "$5}') +done < <(ip link show | awk ' !/^\s/{sub(/:/,"",$2);IFACE=$2} /link.ether/{if (IFACE !~/^vmnet/) print IFACE" "$2}') for dev in $LAN; do if [ "$(ethtool -i $dev 2>/dev/null|awk '/^bus-info:/{print $2}')" == "ieee1394" ]; then isauto="0" -- 2.1.4