Index: nutchez-0.2/src/test/client_install_func.sh
===================================================================
--- nutchez-0.2/src/test/client_install_func.sh	(revision 140)
+++ nutchez-0.2/src/test/client_install_func.sh	(revision 142)
@@ -39,8 +39,13 @@
 echo -e "\nCheck dependent packages"
 if [ "$Linux_Distribution" == "Ubuntu" ] || [ "$Linux_Distribution" == "Debian" ] ;then
+    echo -e "\nIt will install sime packages (expect, ssh, and dialog).\n"
     aptitude install -y expect ssh dialog
 # rpm 系列系統
 elif [ "$Linux_Distribution" == "Fedora" ] || [ "$Linux_Distribution" == "CentOS" ] ;then
     echo -e "Plz install expect, ssh, and dialog."
+    exit
+else
+    echo -e "Plz install expect, ssh, and dialog."
+    exit
 fi 
 }
@@ -66,8 +71,13 @@
 echo -e "\n= check_sunJava (debug) ="
 echo -e "\nNutchEz need Sun Java JDK 1.6.x or above version"
-javaPath="/usr/"
-
-test -e $javaPath/bin/java || read -p "Plz input specific Java path\
-(ex./opt/jvm/java-6-sun-1.6.0.20/): " javaPath
+
+yesno="no"
+while [ "$yesno" != "yes" ] 
+do
+    read -p "Plz input Sun Java home path (ex. '/usr/lib/jvm/java-6-sun-1.6.0.12' or using default '/usr' ): " javaPath
+    read -p "Your java is ${javaPath}/bin/java. Is it correct (yes/no): " yesno
+done
+
+test -z JavaPath && $javaPath="/usr"
 
 if [ -e $javaPath/bin/java ]; then
@@ -128,4 +138,5 @@
 }
 
+
 # scp nutchuser@master_ip:~ 把.ssh/目錄複製下來
 # 當使用者輸入nutchuser 密碼時，將此密碼紀錄到Nutchuser_Passwd
@@ -134,36 +145,25 @@
 echo -e "\n= scp_master_nutchuser_sshkey (debug) ="
 echo -e "mkdir -p /home/nutchuser/"
-mkdir -p /home/nutchuser/
-rm -fr /home/nutchuser/.ssh
-
-while [ ! -d "/home/nutchuser/.ssh" ]
-do
-    while [ "$Nutchuser_Passwd" != "$Nutchuser_Passwd2" ]
-    do
-        echo -e "\n"
-        read -p "Plz input nutchuser password of master node: " Nutchuser_Passwd
-        read -p "plz input nutchuser password, again: " Nutchuser_Passwd2
-            if [ "$1" == "$Nutchuser_Passwd2" ]; then
-                echo "Two Passwords match."
-            else
-                echo "two passwords do not match, plz re-input nutchuser's password."
-            fi
-    done
-    
-    unset Nutchuser_Passwd2
-
-    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 \"*: \" { send_user \"Password is error\" }
-    expect eof"
-        if [ ! -d "/home/nutchuser/.ssh" ]; then
-            echo -e "\nPassword  is error, plz re-input nutchuser passwd of master node."
-        else
-            echo -e "\nscp correct."
-        fi
-        echo "chown -R nutchuser:nutchuser /home/nutchuser/.ssh"
-        chown -R nutchuser:nutchuser /home/nutchuser/.ssh
-done
+mkdir -p /home/nutchuser/.ssh/
+rm -fr /home/nutchuser/.ssh/*
+
+unset Nutchuser_Passwd2
+
+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 \"*: \" { send_user \"Password is error\" }
+expect eof"
+
+if [ -e "/home/nutchuser/.ssh/authorized_keys" ]; then
+        echo -e "\nscp correct."    
+    else
+        echo -e "\nscp is error,\n(1)plz check nutchuser password in server\n(2)nutchuser's authorized_keys in server\n(3)server's network status"
+        exit
+    fi
+
+    echo "chown -R nutchuser:nutchuser /home/nutchuser/.ssh"
+    chown -R nutchuser:nutchuser /home/nutchuser/.ssh
+
 }
 
@@ -172,4 +172,18 @@
 function creat_nutchuser_account(){
 echo -e "\n= creat_nutchuser_account (debug) ="
+
+while [ "$Nutchuser_Passwd" != "$Nutchuser_Passwd2" ]
+do
+    echo -e "\n"
+    read -p "Plz input nutchuser password of master node: " Nutchuser_Passwd
+    read -p "plz input nutchuser password, again: " Nutchuser_Passwd2
+        if [ "$Nutchuser_Passwd" == "$Nutchuser_Passwd2" ]; then
+            echo "Two Passwords match."
+        else
+            echo "two passwords do not match, plz re-input nutchuser's password."
+        fi
+done                                                                                                                                    
+   
+unset Nutchuser_Passwd2
 
 if [ $(cat /etc/passwd | grep nutchuser) ]; then
@@ -178,7 +192,7 @@
     set timeout 1
     expect \"*: \"
-    send \"$1\r\"
-    expect \"*: \"
-    send \"$1\r\"
+    send \"$Nutchuser_Passwd\r\"
+    expect \"*: \"
+    send \"$Nutchuser_Passwd\r\"
     expect eof"
 else
@@ -188,7 +202,7 @@
     set timeout 1
     expect \"*: \"
-    send \"$1\r\"
-    expect \"*: \"
-    send \"$1\r\"
+    send \"$Nutchuser_Passwd\r\"
+    expect \"*: \"
+    send \"$Nutchuser_Passwd\r\"
     expect eof"
 fi
@@ -200,9 +214,9 @@
 echo -e "\n= scp_packages (debug) ="
 chmod 777 /opt
-echo "scp -r -o StrictHostKeyChecking=no nutchuser@$1:/opt/nutchez/ /opt/"
-su nutchuser -c "scp -r -o StrictHostKeyChecking=no nutchuser@$1:/opt/nutchez/ /opt/"
-
-echo -e "\nchown -R nutchuser:nutchuser /opt/nutchez/"
-chown -R nutchuser:nutchuser /opt/nutchez/
+echo "scp -r -o StrictHostKeyChecking=no nutchuser@$1:/opt/nutchez /opt/"
+su nutchuser -c "scp -r -o StrictHostKeyChecking=no nutchuser@$1:/opt/nutchez /opt/"
+
+echo -e "\nchown -R nutchuser:nutchuser /opt/nutchez"
+chown -R nutchuser:nutchuser /opt/nutchez
 chmod 755 /opt
 }
