VirtualBox

Changeset 9576 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 10, 2008 4:04:13 PM (17 years ago)
Author:
vboxsync
Message:

Solaris hostif: some fixes to vnicinit script.

File:
1 edited

Legend:

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

    r8892 r9576  
    11#!/bin/bash
     2set -x
    23# Sun xVM VirtualBox
    34# VirtualBox VNIC setup script for Solaris hosts with Crossbow.
     
    3435        # Try obtain a physical NIC that is currently active
    3536        phys_nic=`/usr/sbin/dladm show-dev | /usr/bin/awk 'NF==4 && $2=="up" { print $1 }'`
    36         # Failed to get a currently active NIC, get the first available NIC.
    37         phys_nic=`/usr/sbin/dladm show-link | /usr/bin/nawk '/legacy/ {next} {print $1; exit}'`
    3837        if [ -z "$phys_nic" ]; then
    39             # Failed to get any NICs!
    40             echo "Failed to get a physical NIC to bind to."
    41             exit 1
     38            # Failed to get a currently active NIC, get the first available NIC.
     39            phys_nic=`/usr/sbin/dladm show-link | /usr/bin/nawk '/legacy/ {next} {print $1; exit}'`
     40            if [ -z "$phys_nic" ]; then
     41                # Failed to get any NICs!
     42                echo "Failed to get a physical NIC to bind to."
     43                exit 1
     44            fi
    4245        fi
    4346    fi
    4447
    4548    # To use a specific physical NIC, replace $phys_nic with the name of the NIC.
    46     vnic_name="vnic"`/usr/lib/vna $phys_nic $mac`
     49    vnic_name=`/usr/lib/vna $phys_nic $mac`
    4750    if [ $? != 0 ]; then
    4851        exit 1
    4952    fi
     53
     54    # The vna utility can return the id/name depending on the distro
     55    case "$vnic_name" in
     56        vnic[0-9]*)
     57            vnic_name="$vnic_name"
     58            ;;
     59        *)
     60            vnic_name="vnic$vnic_name"
     61            ;;
     62    esac
    5063else
    5164    vnic_name=$2
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