Changeset 43 in lab


Ignore:
Timestamp:
Jun 26, 2010 9:47:00 AM (14 years ago)
Author:
mitty
Message:
  • add entry to /etc/vmware/locations
  • accept dummy (non exist) device
  • more information
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/vmware/hotaddbridge

    r42 r43  
    1717read num 
    1818# Check if it exists 
    19 if [ -f /dev/vmnet$num ];then 
     19if [ -e /dev/vmnet$num ];then 
    2020    echo "/dev/vmnet$num exists! Exiting." 
    2121    exit 1 
     
    3737ret=$? 
    3838if [ $ret != 0 ];then 
    39     echo "Can't find interface. Exiting!" 
    40     exit 1 
     39    if [ "$1" != "-d" ]; then 
     40        echo "Can't find interface. Exiting!" 
     41        exit 1 
     42    else 
     43        echo "Use dummy device: $interface" 
     44        dummy="Dummy " 
     45    fi 
    4146fi 
    4247 
     
    4449# Create device 
    4550echo "Creating device /dev/vmnet$num" 
    46 mknod /dev/vmnet$num c 119 $num 
     51mknod --mode=600 /dev/vmnet$num c 119 $num 
    4752 
    4853# Add to vmware netmap configuration 
     
    5257echo "Adding network$nextnetnum to /etc/vmware/netmap.conf" 
    5358 
    54 echo "network$nextnetnum.name=\"$interface\"">> /etc/vmware/netmap.conf 
    55 echo "network$nextnetnum.device=\"vmnet$num\"">> /etc/vmware/netmap.conf 
     59echo "network$nextnetnum.name = \"${dummy}Bridged to $interface\"">> /etc/vmware/netmap.conf 
     60echo "network$nextnetnum.device = \"vmnet$num\"">> /etc/vmware/netmap.conf 
    5661 
     62# Add to vmware locations configuration 
     63echo "answer VNET_${num}_NAME ${dummy}Bridged to $interface" >> /etc/vmware/locations 
     64echo "answer VNET_${num}_INTERFACE $interface" >> /etc/vmware/locations 
     65echo "remove_file /dev/vmnet$num" >> /etc/vmware/locations 
     66echo "file /dev/vmnet$num" >> /etc/vmware/locations 
    5767 
    5868# Start Service 
    59 vmnet-bridge -d /var/run/vmnet-bridge-$num.pid -n $num -i $interface 
     69`which vmnet-bridge` -d /var/run/vmnet-bridge-$num.pid -n $num -i $interface 
Note: See TracChangeset for help on using the changeset viewer.