Index: /nutchez-0.2/src/test/client_install
===================================================================
--- /nutchez-0.2/src/test/client_install	(revision 132)
+++ /nutchez-0.2/src/test/client_install	(revision 132)
@@ -0,0 +1,91 @@
+#!/bin/bash
+# Program:
+#   Check root identity and change root to exectue client_install.sh
+# Author: 
+#   Waue, Shunfa, Rock {waue, shunfa, rock}@nchc.org.tw
+# History:
+#   2010/05/20  Rock    First release
+
+# 正式版之後，記的將不必要 read 拿掉 (trace 用的 read)
+
+# 設定 functions 
+. ./client_install_func.sh
+
+# 需要 master_install 設定的參數區
+Master_IP_Address="a.a.a.a";
+
+# 此檔自己用的參數區
+Linux_Distribution="";
+Linux_Version="";
+Nutchuser_Passwd="xxxxxxxx";
+
+# 參數詢問
+yesno="no"
+echo -e "\nYour master IP: $Master_IP_Address"
+echo -e "Your Nutchuser Password: $Nutchuser_Passwd"
+read -p "These data are cooect? (yes/no): " yesno
+              
+if [ "$yesno" == "yes" ] || [ "$yesno" == "y" ] ; then
+    echo "These parameters are correct."
+else
+    echo "Plz edit these parameters in this file."
+    exit
+fi
+
+# 功能邏輯區
+
+
+# 程式邏輯區
+
+# 檢查執行這個程式的是否為root權限
+check_root
+read
+
+# 查出此主機的作業系統,以及版本
+check_systemInfo
+read
+
+# 安裝需要的套件 (目前只支援 deb 套件的系統自動安裝，yum或其他套件系統的則必須手動安裝)
+# 需要套件名稱 ssh, expect, dialog 
+install_packages
+read
+
+# 檢查之前是否有安裝NutchEz
+# 目前先檢查是否有/opt/nutchez 這個資料夾即可
+check_nez_installed
+read
+
+# 檢查是否有安裝sun java ,並檢查是否為jdk 1.6 以上版本
+check_sunJava
+read
+
+# 檢查是否有安裝openssh, openssh-server
+check_ssh
+read
+
+# 檢查是否有安裝dialog
+check_dialog
+read
+
+# 檢查是否安裝 php 5.5
+check_php
+read
+
+# scp nutchuser@master_ip:~ 把.ssh/目錄複製下來
+# 當使用者輸入nutchuser 密碼時，將此密碼紀錄到Nutchuser_Passwd
+# 此步驟若無法連到 master 則跳出
+scp_master_nutchuser_sshkey $Master_IP_Address
+read
+
+# 新增nutchuser 帳號時用 Nutchuser_Passwd 當密碼
+creat_nutchuser_account $Nutchuser_Passwd
+read
+
+# 用scp 複製 master 的設定與安裝資料
+# 目前僅需做到能無礙的複製遠端的/opt/nutchez/到local的/opt/
+scp_packages $Master_IP_Address
+read
+
+# 安裝
+#install_packages
+
Index: tchez-0.2/src/test/client_install.sh
===================================================================
--- /nutchez-0.2/src/test/client_install.sh	(revision 131)
+++ 	(revision )
@@ -1,86 +1,0 @@
-#!/bin/bash
-# Program:
-#   Check root identity and change root to exectue client_install.sh
-# Author: 
-#   Waue, Shunfa, Rock {waue, shunfa, rock}@nchc.org.tw
-# History:
-#   2010/05/20  Rock    First release
-
-# 正式版之後，記的將不必要 read 拿掉 (trace 用的 read)
-
-# 設定 functions 
-. ./client_install_func.sh
-
-# 需要master_install 設定的參數區
-Master_IP_Address="a.a.a.a";
-
-# 此檔自己用的參數區
-Linux_Distribution="";
-Linux_Version="";
-Nutchuser_Passwd="xxxxxxxx";
-
-# 參數詢問
-yesno="no"    
-echo -e "\nYour master IP: $Master_IP_Address"
-echo -e "Your Nutchuser Password: $Nutchuser_Passwd"
-read -p "These data are cooect? (yes/no): " yesno
-              
-if [ "$yesno" == "no" ];then
-    echo "Plz edit these parameters of this file."
-    exit      
-    else      
-#    echo "yes"                                                                                   
-fi
-
-# 功能邏輯區
-
-
-# 程式邏輯區
-
-# 檢查執行這個程式的是否為root權限
-check_root
-read
-
-# 查出此主機的作業系統,以及版本
-check_systemInfo
-read
-
-# 檢查之前是否有安裝NutchEz
-# 目前先檢查是否有/opt/nutchez 這個資料夾即可
-check_nez_installed
-read
-
-# 檢查是否有安裝sun java ,並檢查是否為jdk 1.6 以上版本
-check_sunJava
-read
-
-# 檢查是否有安裝openssh, openssh-server
-check_ssh
-read
-
-# 檢查是否有安裝dialog
-check_dialog
-read
-
-# 檢查是否安裝 php 5.5
-check_php
-read
-
-# scp nutchuser@master_ip:~ 把.ssh/目錄複製下來
-# 當使用者輸入nutchuser 密碼時，將此密碼紀錄到Nutchuser_Passwd
-# 此步驟若無法連到 master 則跳出
-scp_master_nutchuser_sshkey $Master_IP_Address
-read
-
-# 新增nutchuser 帳號時用 Nutchuser_Passwd 當密碼
-creat_nutchuser_account $Nutchuser_Passwd
-read
-
-# 用scp 複製 master 的設定與安裝資料
-# 目前僅需做到能無礙的複製遠端的/opt/nutchez/到local的/opt/
-scp_packages $Master_IP_Address
-read
-
-# 安裝
-#install_packages
-
Index: /nutchez-0.2/src/test/client_install_func.sh
===================================================================
--- /nutchez-0.2/src/test/client_install_func.sh	(revision 131)
+++ /nutchez-0.2/src/test/client_install_func.sh	(revision 132)
@@ -27,5 +27,21 @@
 echo -e "\n= check_systemInfo (debug) ="
 echo -e "\nYour system information are:"
-lsb_release -a 2>/dev/null 
+distribution=$(lsb_release -d 2>/dev/null)
+Linux_Distribution=$(echo $distribution | awk '{print $2}')
+Linux_Version=$(echo $distribution | awk '{print $3}')
+echo $Linux_Distribution , $Linux_Version
+unset distribution
+}
+
+
+# 安裝需要的相依套件 (目前只支援 deb 套件的系統自動安裝，yum或其他套件系統的則需手動安裝)
+function install_packages(){
+# deb 系列系統
+if [ "$Linux_Distribution" == "Ubuntu" ] || [ "$Linux_Distribution" == "Debian" ] ;then
+    aptitude install -y expect ssh dialog
+# rpm 系列系統
+elif [ "$Linux_Distribution" == "Fedora" ] || [ "$Linux_Distribution" == "CentOS" ] ;then
+    echo -e "Plz install expect, ssh, and dialog."
+fi 
 }
 
@@ -35,6 +51,10 @@
 function check_nez_installed(){
 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."
+if [ -d /opt/nutchez ]; then
+    echo -e "\nSystem already had NutchEz."
+    exit
+else
+    echo -e "\nSystem does not has NutchEz."
+fi
 }
 
@@ -177,5 +197,5 @@
     expect eof"
 else
-    echo "System already has nutchuser, create nutchuser and change password."
+    echo "Create nutchuser and change password."
     useradd -m nutchuser -s /bin/bash
     expect -c "spawn passwd nutchuser                 
