Changeset 215 for drbl-virt/sbin/functions_drbl_virt
- Timestamp:
- Oct 19, 2010, 11:14:46 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
drbl-virt/sbin/functions_drbl_virt
r213 r215 2 2 # Program: 3 3 # DRBL virt module 4 # Author: 4 # Author: 5 5 # Jazz, Rock {jazz, rock}@nchc.org.tw 6 6 # Version: … … 18 18 19 19 # [Check Root] 20 function check_root(){ 20 function check_root(){ 21 21 if [ $USER != "root" ]; then 22 22 echo -e "Please change root to run it!" 23 23 exit 24 24 fi 25 } 25 } 26 26 27 27 # [Change root to run] … … 71 71 VMM_select=1 72 72 echo "Xen" > $Work_Home/etc/hypervisior 73 fi 74 } 73 fi 74 } 75 75 76 76 77 77 # [Check Hypervisior] 78 78 function check_hypervisior(){ 79 hypervisior=$(cat $Work_Home/etc/hypervisior) 79 hypervisior=$(cat $Work_Home/etc/hypervisior) 80 80 } 81 81 … … 116 116 for Kernel in $Kernels 117 117 do 118 echo "($i) $Kernel" 118 echo "($i) $Kernel" 119 119 i=i+1 120 120 done … … 207 207 echo "Input VM number/IP range for $eth (ex. 40)." 208 208 echo "default is the same numbers of drbl clients" 209 209 210 210 211 211 jude_2="no" … … 233 233 234 234 # [Get VM prefix name] 235 #function get_VM_prefix_name(){ 235 #function get_VM_prefix_name(){ 236 236 #jude="no" 237 237 #while [ $jude != "yes" -a $jude != "y" ]; … … 357 357 function delete_duplicating_MAC(){ 358 358 drbl_mac_file="/etc/drbl/macadr-$eth.txt" 359 # if macadr-ethX.txt.drbl-virt_bak already have, backup it 359 # if macadr-ethX.txt.drbl-virt_bak already have, backup it 360 360 # else cp default backup 361 361 if [ -e $drbl_mac_file.drbl-virt_bak ]; then 362 362 cp $drbl_mac_file $drbl_mac_file.$(date +%Y-%m-%d-%H-%M-%S).drbl-virt_bak 363 363 cp -f $drbl_mac_file.drbl-virt_bak $drbl_mac_file 364 else 364 else 365 365 cp $drbl_mac_file $drbl_mac_file.drbl-virt_bak 366 366 fi … … 380 380 fi 381 381 done 382 } 382 } 383 383 384 384 … … 424 424 425 425 426 # [Download tomcat and mv drbl-virt.wat to wepapps] 426 # [Download tomcat and mv drbl-virt.wat to wepapps] 427 427 function install_tomcat_and_mv_drbl-virt(){ 428 428 if [ ! -e $Work_Home/tomcat-7.0.2.tar.gz ]; then 429 429 wget http://drbl-virt.googlecode.com/files/tomcat-7.0.2.tar.gz -P $Work_Home 430 fi 430 fi 431 431 tar zxvf $Work_Home/tomcat-7.0.2.tar.gz -C $Work_Home/ 432 432 mv $Work_Home/drbl-virt.war $Work_Home/tomcat-7.0.2/webapps/ … … 440 440 # [Cehck KVM kernel & version] 441 441 function check_kvm(){ 442 echo -e "\nCheck this kernel..." 442 443 KVM_Kernel=$(uname -r) 443 } 444 445 444 445 grep -E '(CONFIG_KVM=m|CONFIG_KVM=y)' /boot/config-${KVM_Kernel} >> /dev/null 446 if [ $? -eq 0 ]; then 447 echo "This Kernel supportes KVM !!!" 448 else 449 echo "This Kernel doesn't support KVM !!!" 450 echo "Please change Kernel." 451 exit 452 fi 453 } 454
Note: See TracChangeset
for help on using the changeset viewer.