Changeset 9598 in vbox for trunk/src/VBox
- Timestamp:
- Jun 11, 2008 10:30:03 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/solaris/vnicinit_solaris.sh
r9577 r9598 29 29 # Create the VNIC if required 30 30 if [ -z "$2" ]; then 31 # Try obtain a physical NIC that is currently active 32 phys_nic=`/usr/sbin/dladm show-dev | /usr/bin/awk 'NF==7 && $3=="up" { print $1 }'` 31 # snv <= 82 is to handled differently (dladm format changes at 83+) 32 snv_str=`uname -v` 33 snv_num=${snv_str##*[a-z][_]} 34 35 # Try obtain one that's currently active (82 dladm show-link doesn't indicate status; just use show-dev atm) 36 if [ $snv_num -le 82 ]; then 37 phys_nic=`/usr/sbin/dladm show-dev -p | /usr/bin/awk 'NF==4 && $2=="link=up" { print $1 }'` 38 else 39 phys_field=`/usr/sbin/dladm show-link -p | /usr/bin/awk 'NF==5 && $4=="STATE=\"up\"" { print $1 }'` 40 eval $phys_field 41 phys_nic="$LINK" 42 fi 43 33 44 if [ -z "$phys_nic" ]; then 34 # Try obtain a physical NIC that is currently active 35 phys_nic=`/usr/sbin/dladm show-dev | /usr/bin/awk 'NF==4 && $2=="up" { print $1 }'` 45 # Failed to get a currently active NIC, get the first available link. 46 if [ $snv_num -le 82 ]; then 47 phys_nic=`/usr/sbin/dladm show-link -p | /usr/bin/nawk '/legacy/ {next} {print $1; exit}'` 48 else 49 phys_field=`/usr/sbin/dladm show-link -p | /usr/bin/awk 'NF==5 && $2=="CLASS=\"phys\"" { print $1 }'` 50 eval $phys_field 51 phys_nic="$LINK" 52 fi 36 53 if [ -z "$phys_nic" ]; then 37 # Failed to get a currently active NIC, get the first available NIC. 38 phys_nic=`/usr/sbin/dladm show-link | /usr/bin/nawk '/legacy/ {next} {print $1; exit}'` 39 if [ -z "$phys_nic" ]; then 40 # Failed to get any NICs! 41 echo "Failed to get a physical NIC to bind to." 42 exit 1 43 fi 54 # Failed to get any NICs! 55 echo "Failed to get a physical NIC to bind to." 56 exit 1 44 57 fi 45 58 fi
Note:
See TracChangeset
for help on using the changeset viewer.