Index: drbl-virt/sbin/functions_drbl_virt
===================================================================
--- drbl-virt/sbin/functions_drbl_virt	(revision 183)
+++ drbl-virt/sbin/functions_drbl_virt	(revision 184)
@@ -174,8 +174,5 @@
 fi
 
-# get eth network
-eth_address=$(/opt/drbl/bin/drbl-get-ipadd $eth)
-eth_netmask=$(/opt/drbl/bin/drbl-get-netmask $eth)
-eth_network=$(/opt/drbl/bin/drbl-get-network $eth_address $eth_netmask)
+# get eth network X.X.X
 eth_network_f3=$(echo $eth_network | cut -d "." -f 1-3)
 
@@ -214,5 +211,6 @@
     done
 
-    read -p "Input Prefix name for VM for $eth (ex. drblvm): " VM_prefix_name
+    #read -p "Input Prefix name for VM for $eth (ex. drblvm): " VM_prefix_name
+    VM_prefix_name=$(cat /etc/drbl/drblpush.conf  | grep hostname= | sed 's/hostname=//')
     read -p "Is it correct? (yes/no): " jude
 done
@@ -238,5 +236,5 @@
 VM_Host_totoal_nu=$((${Host_last_IP_4}-1+${VM_IP_range}))
 if [ -e /opt/drbl-virt/etc/IP_VM_$eth ]; then
-    mv /opt/drbl-virt/etc/IP_VM_$eth /opt/drbl-virt/etc/IP_VM_${eth}.$(date +%Y-%m-%d-%H-%M-%S).drbl-virt_bak
+    mv -f /opt/drbl-virt/etc/IP_VM_$eth /opt/drbl-virt/etc/IP_VM_${eth}.$(date +%Y-%m-%d-%H-%M-%S).drbl-virt_bak
 fi
 declare -i VM_IP_0=$VM_prefix_eth
@@ -275,5 +273,4 @@
             echo "${eth_network_f3}.${VM_IP_1} ${VM_prefix_name}${VM_IP_0}${VM_IP_1}" >> /opt/drbl-virt/etc/IP_VM_$eth
         fi
-
     done
 
@@ -297,5 +294,5 @@
 
 # backup
-mv /opt/drbl-virt/etc/macadr-VM-$eth.txt /opt/drbl-virt/etc/macadr-VM-$eth.txt.$(date +%Y-%m-%d-%H-%M-%S).drbl-virt_bak
+mv -f /opt/drbl-virt/etc/macadr-VM-$eth.txt /opt/drbl-virt/etc/macadr-VM-$eth.txt.$(date +%Y-%m-%d-%H-%M-%S).drbl-virt_bak
 
 # generate MAC
@@ -318,7 +315,20 @@
     fi
 done
-
-
-}
-
-
+}
+
+function add_VM_dhcpd_conf(){
+# backup dhcpd.conf
+if [ -e /etc/dhcp3/dhcpd.conf ]; then
+cp -f /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.conf.drbl-virt_bak
+fi
+
+subnet_lines=$(cat -n /etc/dhcp3/dhcpd.conf | grep $eth_network | awk '{print $1}')
+host_lines=$(cat -n /etc/dhcp3/dhcpd.conf | grep 'host ' | grep '{' | awk '{print $1}')
+
+for subnet_line in $subnet_lines
+do
+    host_lines cat -n /etc/dhcp3/dhcpd.conf | sed -n "$subnet_line,\$p" | grep 'host .* {' | awk '{print $1}'
+
+done
+
+}
