Index: nutchez-0.2/src/test/client_install_func.sh
===================================================================
--- nutchez-0.2/src/test/client_install_func.sh	(revision 123)
+++ nutchez-0.2/src/test/client_install_func.sh	(revision 128)
@@ -13,5 +13,5 @@
 function check_root(){
 # 正式版後可拿掉此 echo
-echo -e "\n= check_root ="
+echo -e "\n= check_root (debug) ="
 if [ $USER != "root" ]; then
     echo -e "\nPlz Change root to execute it!!!"
@@ -25,5 +25,5 @@
 # 查出此主機的作業系統,以及版本
 function check_systemInfo(){
-echo -e "\n= check_systemInfo ="
+echo -e "\n= check_systemInfo (debug) ="
 echo -e "\nYour system information are:"
 lsb_release -a 2>/dev/null 
@@ -34,7 +34,7 @@
 # 目前先檢查是否有/opt/nutchez 這個資料夾即可
 function check_nez_installed(){
-    echo -e "\n= chcheck_nez_installed ="
-    test -d /opt/nutchez && echo -e "\nYour system already had NutchEz." || \
-    echo -e "\nYour system does not has NutchEz."
+echo -e "\n= chcheck_nez_installed (debug) ="
+test -d /opt/nutchez && echo -e "\nYour system already had NutchEz." || \
+echo -e "\nYour system does not has NutchEz."
 }
 
@@ -44,5 +44,5 @@
 # (3)系統有安裝但Sun Java 在非預設路徑下 (4)以正確安裝 Sun JAVA 預設路徑下
 function check_sunJava(){
-echo -e "\n= check_sunJava ="
+echo -e "\n= check_sunJava (debug) ="
 echo -e "\nNutchEz need Sun Java JDK 1.6.x or above version"
 javaPath="/usr/"
@@ -60,10 +60,12 @@
         exit    
     fi
-    
-    if [ $JAVA_version -lt "1.6" ]; then
+   
+    large16=$(echo "$JAVA_version >= 1.6" | bc)
+    if [ "${large16}" == 0 ]; then
         echo "Java version is too old (it need 1.6.X above)"
         exit
     fi
-
+    
+    echo "System has Sun Java 1.6 above version."
 else
     echo "Plz install Sun JAVA 1.6.X or above version"
@@ -78,5 +80,5 @@
 # 檢查是否有安裝openssh, openssh-server
 function check_ssh(){
-echo -e "\n= check_ssh ="
+echo -e "\n= check_ssh (debug) ="
 if [ -e /usr/bin/ssh ]; then
     echo -e "\nSystem has ssh."
@@ -97,5 +99,5 @@
 # 檢查是否有安裝dialog
 function check_dialog(){
-echo -e "\n= check_dialog ="
+echo -e "\n= check_dialog (debug) ="
 if [ -e /usr/bin/dialog ]; then
     echo -e "\nSystem has dialog."
@@ -109,10 +111,56 @@
 # 檢查是否安裝 php 5.5
 function check_php(){
-echo -e "\n= check_php ="
+echo -e "\n= check_php (debug) ="
 if [ "$(php -v 2>/dev/null | grep "PHP 5" | awk '{print $2}' | cut -d "." -f1)" == 5 ]; then
     echo -e "\nPHP'version is 5"
 else
-    echo -e "\nplz  install PHP 5 version"
+    echo -e "\nplz install PHP 5 version!"
 #    exit
 fi
 }
+
+
+# scp nutchuser@master_ip:~ 把.ssh/目錄複製下來
+# 當使用者輸入nutchuser 密碼時，將此密碼紀錄到Nutchuser_Passwd
+# 此步驟若無法連到 master 則跳出
+function scp_master_nutchuser_sshkey(){
+echo -e "\n= scp_master_nutchuser_sshkey (debug) ="
+echo -e "mkdir -p /home/nutchuser/"
+mkdir -p /home/nutchuser/
+read -p "Plz input nutchuser passwd of mater node: " Nutchuser_Passwd
+
+echo -e "scp nutchuser@$1:~/.ssh /home/nutchuser/"
+expect -c "spawn scp -r -o StrictHostKeyChecking=no nutchuser@$1:~/.ssh /home/nutchuser/
+expect \"*: \"
+send \"$Nutchuser_Passwd\r\"
+expect eof"
+
+chown -R nutchuser:nutchuser /home/nutchuser/.ssh
+}
+
+
+# 新增nutchuser 帳號時用 Nutchuser_Passwd 當密碼
+function creat_nutchuser_account(){
+echo -e "\n= creat_nutchuser_account (debug) ="                             
+read -p "Create nutchuser, plz input nutchuser's password: " Nutchuser_Passwd
+useradd -m nutchuser -s /bin/bash
+
+expect -c "spawn passwd nutchuser                 
+expect \"*: \" 
+send \"$1\r\"
+expect \"*: \" 
+send \"$1\r\" 
+expect eof"
+}
+
+
+# 用scp 複製 master 的設定與安裝資料
+# 目前僅需做到能無礙的複製遠端的/opt/nutchez/到local的/opt/
+function scp_packages(){
+echo -e "\n= scp_packages (debug) ="
+echo "scp -r -o StrictHostKeyChecking=no nutchuser@$1:/opt/nutchez/ /opt/"
+scp -r -o StrictHostKeyChecking=no nutchuser@$1:/opt/nutchez/ /opt/
+
+echo "chown -R nutchuser:nutchuser /opt/nutchez/"
+chown -R nutchuser:nutchuser /opt/nutchez/
+}
