Index: drbl-virt/sbin/functions_drbl_virt
===================================================================
--- drbl-virt/sbin/functions_drbl_virt	(revision 179)
+++ drbl-virt/sbin/functions_drbl_virt	(revision 180)
@@ -50,4 +50,5 @@
 # [Select Hypervisior(Xen/KVM)]
 function VMM_select(){
+echo ""
 if [ $cpu_flag == "yes" ]; then
     while [ "$VMM_select" != "1" -a "$VMM_select" != "2"  ]
@@ -56,7 +57,7 @@
     done
 	if [ $VMM_select == "1"  ]; then
-	  echo "Xen" > $Work_Home/.tmp/hypervisior
+	  echo "Xen" > $Work_Home/etc/hypervisior
 	else
-	  echo "KVM" > $Work_Home/.tmp/hypervisior
+	  echo "KVM" > $Work_Home/etc/hypervisior
 	fi	
 else
@@ -65,5 +66,5 @@
     echo ""
     VMM_select=1
-    echo "Xen" > $Work_Home/.tmp/hypervisior
+    echo "Xen" > $Work_Home/etc/hypervisior
 fi  
 }   
@@ -73,4 +74,5 @@
 function install_drbl-virt_dir(){
     mkdir -p $Work_Home/.tmp
+    mkdir -p $Work_Home/etc
 }
 
@@ -78,5 +80,5 @@
 # [Check Hypervisior]
 function check_hypervisior(){
-    hypervisior=$(cat $Work_Home/.tmp/hypervisior)    
+    hypervisior=$(cat $Work_Home/etc/hypervisior)    
 }
 
@@ -154,40 +156,69 @@
 
 
+function get_DRBL_eth(){
+eths=$(ls /etc/drbl | grep macadr-eth[0-9] | grep [0-9].txt | cut -d "-" -f2 | cut -d "." -f1)
+eths_nu=$(echo $eths | wc -l)
+
+
+}
+
 function get_Host_IP_range(){
-cat /etc/drbl/IP_HOST_TABLE | sed "${Host_first_Line}p" 
-cat /etc/drbl/IP_HOST_TABLE | sed "${Host_final_Line}p"                    
-declare -i Host_first_Line=$(cat -n /etc/drbl/IP_HOST_TABLE  | grep "# Created by DRBL (drblpush), begin" | awk '{print $1}')
-Host_first_Line=$((${Host_first_Line}+1))
-                        
-declare -i Host_final_Line=$(cat -n /etc/drbl/IP_HOST_TABLE  | grep "# Created by DRBL (drblpush), end" | awk '{print $1}')
-Host_final_Line=$((${Host_final_Line}-1))
-#echo "$Host_first_Line"
-#echo "$Host_final_Line"
-                                                                           
-Host_first_IP=$(cat /etc/drbl/IP_HOST_TABLE | sed -n "${Host_first_Line}p"| awk '{print $1}')
-Host_final_IP=$(cat /etc/drbl/IP_HOST_TABLE | sed -n "${Host_final_Line}p"| awk '{print $1}')
-#echo $Host_first_IP                                                                                                                                                 
-#echo $Host_final_IP
+if [ ! -e /usr/bin/ipcalc ] || [ ! -e /opt/drbl/bin/drbl-get-network ] || [ ! -e /opt/drbl/bin/drbl-get-ipadd ]; then
+    echo "Don't find /usr/bin/ipcalc /opt/drbl/bin/drbl-get-network & /opt/drbl/bin/drbl-get-ipadd"
+    exit 0
+fi
+
+# get eth network
+eth_address=$(/opt/drbl/bin/drbl-get-ipadd $1)
+eth_netmask=$(/opt/drbl/bin/drbl-get-netmask $1)
+eth_network=$(/opt/drbl/bin/drbl-get-network $eth_address $eth_netmask)
+eth_network_f3=$(echo $eth_network | cut -d "." -f 1-3)
+
+IP_nu=$(cat /etc/drbl/IP_HOST_TABLE | grep $eth_network_f3 | wc -l)
+Host_first_IP=$(cat /etc/drbl/IP_HOST_TABLE | grep $eth_network_f3 | awk "NR==1 {print $1}" | awk '{print 1}')
+Host_last_IP=$(cat /etc/drbl/IP_HOST_TABLE | grep $eth_network_f3 | awk "NR==$IP_nu {print $1}"| awk '{print $1}')
+
 }
 
 function get_VM_IP_range(){
-echo ""        
-echo "Your drbl client IP range $Host_first_IP ~ $Host_final_IP"
-declare -i Host_final_IP_4=$(echo $Host_final_IP | cut -d "." -f4)
-Host_final_IP_4=$(($Host_final_IP_4+1))                       
-VM_first_IP=$(echo $Host_final_IP | cut -d "." -f 1-3)
-VM_first_IP="${VM_first_IP}.${Host_final_IP_4}"       
-echo "The VM IP Range will start from $VM_first_IP"   
-while [ $jude != "yes" -a $jude != "y" ];             
-do             
-    read "Input your IP range for VM: " VM_IP_range   
-done           
-echo "VM_first_IP=$VM_first_IP" > $Work_Home/.tmp/IP_VM_TABLE
-echo "VM_IP_range=$VM_IP_range" >> $Work_Home/.tmp/IP_VM_TABLE
-
-}
-
-# [DRBL Check]
-
-
-
+echo ""
+echo "DRBL client IP range -> $1 [$Host_first_IP ~ $Host_last_IP]"
+
+declare -i Host_last_IP_4=$(echo $Host_last_IP | cut -d "." -f4)
+Host_last_IP_4=$(($Host_last_IP_4+1))
+VM_first_IP=$(echo $Host_last_IP | cut -d "." -f 1-3)
+VM_first_IP="${VM_first_IP}.${Host_last_IP_4}"
+
+echo "The VM IP Range will start from -> [$VM_first_IP]"
+jude="no"
+while [ $jude != "yes" -a $jude != "y" ];
+do
+    echo ""
+    echo "Input VM number/IP range in $1 (ex. 40)."
+    read -p "(If you have 10 PCs(4-core), suggestion is 30): " VM_IP_range
+    read -p "Is it correct? (yes/no): " jude
+done
+
+#echo "VM_first_IP=$VM_first_IP"
+#echo "VM_IP_range=$VM_IP_range"
+}
+
+function get_VM_prefix_name(){ 
+jude="no"
+while [ $jude != "yes" -a $jude != "y" ];
+do
+    echo ""
+    read -p "Input Prefix name for VM in $1 (ex. drblvm): " VM_prefix_name
+    read -p "Is it correct? (yes/no): " jude
+done
+#echo "VM_prefix_name=$VM_prefix_name"
+}
+
+function create_VM_IP_table(){
+#/etc/drbl-virt/etc/IP_VM_eth
+
+}
+
+
+
+
