Changeset 192


Ignore:
Timestamp:
Aug 27, 2010, 6:28:55 PM (14 years ago)
Author:
rock
Message:

BugFix?: drbl_PXE_PV-VM_create.sh

File:
1 edited

Legend:

Unmodified
Added
Removed
  • drbl-virt/sbin/drbl_PXE_PV-VM_create.sh

    r191 r192  
    3333echo "-h    deploy vm to which host"
    3434echo "Examples: "
    35 echo "drbl_PXE_PV-VM_create.sh options -v drbl110 -c 2 -ram 512 -h drbl101"
     35echo "drbl_PXE_PV-VM_create.sh options -v drbl110 -c 2 -r 512 -h drbl101"
    3636}
    3737
     
    4141# = 1. Parse parameters =
    4242if [ $# -eq 0 ]; then
    43 Usage
     43Usage && exit
    4444fi
    4545
     
    114114for IP_VM_file in $IP_VM_files
    115115do
    116     IP_VM_line=$(cat -n $IP_VM_file | grep "$vm_name" | awk '{print $1}')
     116    IP_VM_line=$(cat -n $Work_Home/etc/$IP_VM_file | grep "$vm_name" | awk '{print $1}')
    117117    if [ -n $IP_VM_line ]; then
    118118        IP_VM_right_file=$IP_VM_file
     
    131131# start get mac address
    132132IP_VM_eth=$(echo $IP_VM_right_file | sed 's/IP_VM_//g' )
    133 vm_mac=$(cat $Work_Home/etc/macadr-VM-${IP_VM_eth}.txt | sed -n "${IP_VM_right_line}")
     133vm_mac=$(cat $Work_Home/etc/macadr-VM-${IP_VM_eth}.txt | sed -n "${IP_VM_right_line}p")
    134134
    135135# = 3. Generate PXE PV-VM configuration  =
     
    139139
    140140vm_cfg=${home_dir}/${vm_name}.cfg
     141
     142if [ -e $vm_cfg ]; then
    141143rm $vm_cfg
     144fi
    142145
    143146# start to generate
Note: See TracChangeset for help on using the changeset viewer.