VirtualBox

Ignore:
Timestamp:
Feb 25, 2008 9:49:05 AM (17 years ago)
Author:
vboxsync
Message:

Solaris: fixes for handling existing VNIC on our hostif setup script.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/solaris/vnicinit_solaris.sh

    r5998 r7102  
    2222fi
    2323
    24 # Try obtain a physical NIC that is currently active
    25 phys_nic=`/usr/sbin/dladm show-dev | /usr/bin/awk 'NF==7 && $3=="up" { print $1 }'`
    26 if [ -z "$phys_nic" ]; then
    27     # Failed to get a currently active NIC, get the first available NIC.
    28     phys_nic=`/usr/sbin/dladm show-link | /usr/bin/nawk '/legacy/ {next} {print $1; exit}'`
    29     if [ -z "$phys_nic" ]; then
    30         # Failed to get any NICs!
    31         echo "Failed to get a physical NIC to bind to."
    32         exit 1
    33     fi
    34 fi
    35 vnic_id=0
    36 vnic_name=""
    3724mac=$1
    38 
    3925# Create the VNIC if required
    4026if [ -z "$2" ]; then
     27    # Try obtain a physical NIC that is currently active
     28    phys_nic=`/usr/sbin/dladm show-dev | /usr/bin/awk 'NF==7 && $3=="up" { print $1 }'`
     29    if [ -z "$phys_nic" ]; then
     30        # Failed to get a currently active NIC, get the first available NIC.
     31        phys_nic=`/usr/sbin/dladm show-link | /usr/bin/nawk '/legacy/ {next} {print $1; exit}'`
     32        if [ -z "$phys_nic" ]; then
     33            # Failed to get any NICs!
     34            echo "Failed to get a physical NIC to bind to."
     35            exit 1
     36        fi
     37    fi
     38
    4139    # To use a specific physical NIC, replace $phys_nic with the name of the NIC.
    4240    vnic_id=`/usr/lib/vna $phys_nic $mac`
     
    7674
    7775echo "$vnic_name"
    78 exit $?
     76exit 0
    7977
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette