Changeset 208 for drbl-virt/sbin/drbl_PXE_PV-VM_create
- Timestamp:
- Oct 3, 2010, 1:19:59 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
drbl-virt/sbin/drbl_PXE_PV-VM_create
r207 r208 26 26 # = 2. Functions declation = 27 27 Usage(){ 28 echo "Usage: drbl_PXE_PV-VM_create .sh options"28 echo "Usage: drbl_PXE_PV-VM_create [options]" 29 29 echo "Options: " 30 30 echo "-v|--vm vm name" … … 32 32 echo "-r|--ram ram size(M) (default: 128)" 33 33 echo "Examples: " 34 echo "drbl_PXE_PV-VM_create .sh options-v drbl131 -c 2 -r 512"34 echo "drbl_PXE_PV-VM_create -v drbl131 -c 2 -r 512" 35 35 } 36 36 … … 39 39 check_root 40 40 # = 1. Parse parameters = 41 if [ $# -eq 0 ]; then42 Usage && exit43 fi44 45 41 while [ $# -gt 0 ]; do 46 42 case "$1" in … … 108 104 [ -z $vm_name ] && echo "[Error] no VM name" && Usage && exit 2 109 105 # check vm_name exist 110 vm_IP_files=$(ls $Work_Home/etc/IP_VM_eth*)106 IP_VM_files=$(ls $Work_Home/etc | grep 'IP_VM_eth[0-9]$') 111 107 vm_exist_jude="no" 112 for vm_IP_file in $ vm_IP_files108 for vm_IP_file in $IP_VM_files 113 109 do 114 if [ -n "$(grep "$vm_name" $ vm_IP_file)" ]; then110 if [ -n "$(grep "$vm_name" $Work_Home/etc/$vm_IP_file)" ]; then 115 111 vm_exist_jude="yes" 116 112 fi … … 126 122 # = 2. Get VM MAC address = 127 123 #IP_MAC_files=$(ls $Work_Home/etc | grep 'macadr-VM-eth[0-9]*.txt') 128 129 IP_VM_files=$(ls $Work_Home/etc | grep 'IP_VM_eth[0-9]*')130 124 IP_VM_right_file="" 131 125 IP_VM_right_line=""
Note: See TracChangeset
for help on using the changeset viewer.