]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
The Linux network script has been updated to prefer 'ip' command over the
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:22:43 +0000 (11:22 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:22:43 +0000 (11:22 -0700)
'ifconfig' command for gathering network information.

open-vm-tools/scripts/linux/network

index d9142a7a0dd788f346a33db4b4b8059b0b7f3998..ded2c88be3ec2ba883901b8e611bb2da65a1cb52 100644 (file)
@@ -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)