From: Oliver Kurth Date: Fri, 15 Sep 2017 18:22:43 +0000 (-0700) Subject: The Linux network script has been updated to prefer 'ip' command over the X-Git-Tag: stable-10.2.0~714 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2e2da21bc35ee3f549fdeb3bfd2d603e1ad4975b;p=thirdparty%2Fopen-vm-tools.git The Linux network script has been updated to prefer 'ip' command over the 'ifconfig' command for gathering network information. --- diff --git a/open-vm-tools/scripts/linux/network b/open-vm-tools/scripts/linux/network index d9142a7a0..ded2c88be 100644 --- a/open-vm-tools/scripts/linux/network +++ b/open-vm-tools/scripts/linux/network @@ -330,9 +330,11 @@ save_active_NIC_list() >$activeList - # Find out all the non-loopback up interfaces. Use ifconfig if available - # otherwise fall back to the ip command. - if [ -z "$ifconfig_cmd" ]; then + # Find out all the non-loopback up interfaces. Use ip if available + # otherwise fall back to the ifconfig command. + # ifconfig is buggy on some platforms and truncates long + # network names + if [ -n "$ip_cmd" ]; then for nic in $($ip_cmd link show up | egrep '\bUP\b' | awk -F: '{print $2}'); do $ip_cmd link show ${nic%@*} | grep -iq 'link/ether' && echo ${nic%@*} >> $activeList done @@ -363,7 +365,7 @@ rescue_NIC() if [ -f "$activeList" ]; then while read nic; do - if [ -z "$ifconfig_cmd" ]; then + if [ -n "$ip_cmd" ]; then intf_out=$($ip_cmd link show $nic up) else intf_out=$($ifconfig_cmd $nic)