Index: /nutchez-0.2/src/shell/add_hosts
===================================================================
--- /nutchez-0.2/src/shell/add_hosts	(revision 217)
+++ /nutchez-0.2/src/shell/add_hosts	(revision 217)
@@ -0,0 +1,47 @@
+#!/bin/bash
+# Program:
+#   Add nutch_nodes to /etc/hosts (for nutchez management interface).
+#   $1=/home/nutchuser/nutchez/system/nutch_nodes
+#   $2=/etc/hosts
+# Author: 
+#   Waue, Shunfa, Rock {waue, shunfa, rock}@nchc.org.tw
+# Version:
+#    1.0
+# History:
+#   2010/06/07  Rock    First release (1.0)
+
+IPs=$(cat $1 | awk '{print $1}')
+HOSTNAMEs=$(cat $1 | awk '{print $2}')
+
+# 刪除相同的 ip 在 /etc/hosts 和 nutch_nodes
+for ip_addr in $(echo $IPs)
+do
+    jude=0
+    cat $2 | grep ${ip_addr} || jude=1
+
+    if [ $jude == 0 ]; then
+        del_line=$(cat -n $2 | grep ${ip_addr} | awk '{print $1}')
+        sed -i "${del_line}d" $2
+    fi
+done
+
+# 刪除相同的 hostname 在 /etc/hosts 和 nutch_nodes
+for host_name in $(echo $HOSTNAMEs)
+do
+    jude=0
+    cat $2 | grep ${host_name} || jude=1
+
+    if [ $jude == 0 ]; then
+        del_line=$(cat -n $2 | grep ${host_name} | awk '{print $1}')
+        sed -i "${del_line}d" $2
+    fi
+done
+
+# Backup /etc/hosts
+cp -f "$2" "$2.bak"
+
+# attache nutch_nodes to hosts
+sed -i '/# NutchEz add/d' $2
+echo "# NutchEz add" >>$2
+cat $1 | grep -v '#' >>$2
+
Index: /nutchez-0.2/src/shell/client_install
===================================================================
--- /nutchez-0.2/src/shell/client_install	(revision 217)
+++ /nutchez-0.2/src/shell/client_install	(revision 217)
@@ -0,0 +1,99 @@
+#!/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)
+
+# 需要 master_install 設定的參數區
+# Master IP here
+Master_IP_Address="input.your.master.ip_address"
+# Master Hostname here
+Master_Hostname="input_your_master_hostname"
+# 此檔自己用的參數區
+Linux_Distribution="";
+Linux_Version="";
+Nutchuser_Passwd="xxxxxxxxxx";
+Work_Path="./"
+Work_Path_J=0
+
+# Work Path Setup
+echo $0 | grep '/' || Work_Path_J=1
+if [ "$Work_Path_J" == "0"  ]; then
+    Work_Path=$(echo $0 | sed 's/client_install//')
+fi
+# Source functions
+source $Work_Path/client_install_func.sh
+
+# Language Choice
+choose_lang
+
+# 參數詢問
+yesno="no"
+show_info "$par_echo_1 $Master_IP_Address"
+read -p "$par_echo_2" yesno
+              
+if [ "$yesno" == "yes" ] || [ "$yesno" == "y" ] ; then
+    show_info "$par_echo_3"
+else
+    show_info "$par_echo_4"
+    exit
+fi
+
+
+# 檢查執行這個程式的是否為root權限
+check_root
+read -p "continue.."
+
+# 查出此主機的作業系統,以及版本
+check_systemInfo
+read -p "continue.."
+
+# 安裝需要的套件 (目前只支援 deb 套件的系統自動安裝，yum或其他套件系統的則必須手動安裝)
+# 需要套件名稱 ssh, expect, dialog 
+install_packages
+read -p "continue.."
+
+# 檢查之前是否有安裝NutchEz
+# 目前先檢查是否有/opt/nutchez 這個資料夾即可
+check_nez_installed
+read -p "continue.."
+
+# 檢查是否有安裝sun java ,並檢查是否為jdk 1.6 以上版本
+check_sunJava
+read -p "continue.."
+
+# 檢查是否有安裝openssh, openssh-server
+check_ssh
+read -p "continue.."
+
+# 檢查是否有安裝dialog
+check_dialog
+read -p "continue.."
+
+# 新增nutchuser 帳號時用 Nutchuser_Passwd 當密碼
+creat_nutchuser_account
+read -p "continue.."
+
+# scp nutchuser@master_ip:~ 把.ssh/目錄複製下來
+# 當使用者輸入nutchuser 密碼時，將此密碼紀錄到Nutchuser_Passwd
+# 此步驟若無法連到 master 則跳出
+scp_master_nutchuser_sshkey $Master_IP_Address
+read -p "continue.."
+
+# 用scp 複製 master 的設定與安裝資料
+# 目前僅需做到能無礙的複製遠端的/opt/nutchez/到local的/opt/
+scp_packages $Master_IP_Address
+read -p "continue.."
+
+# 安裝及啟動
+install_nutch_package
+read -p "continue.."
+
+# 回覆 Hostname 和 IP 給 Master Server
+recall_hostname_ip $Master_IP_Address
+show_info "$CI_finish_echo_1"
+read -p "continue.."
Index: /nutchez-0.2/src/shell/client_install_func.sh
===================================================================
--- /nutchez-0.2/src/shell/client_install_func.sh	(revision 217)
+++ /nutchez-0.2/src/shell/client_install_func.sh	(revision 217)
@@ -0,0 +1,336 @@
+#!/bin/bash
+# Program:
+#   Functions for client_install.sh
+# Author: 
+#   Waue, Shunfa, Rock {waue, shunfa, rock}@nchc.org.tw
+# History:
+#   2010/05/20  Rock    First release(0.1)
+
+# 正式版之後，記的將不必要的 echo 拿掉
+function debug_info () {
+#  if [ $? -eq 0 ]; then
+    echo -e "\033[1;35;40m info - $1 \033[0m"
+#  fi
+}
+
+function show_info () {
+#  if [ $? -eq 0 ]; then
+    echo -e "\033[1;32;40m $1 \033[0m"
+#  fi
+}
+
+
+# choose Language
+function choose_lang(){
+
+lang=$(locale | grep 'LANG=' | cut -d "=" -f2)
+
+# Default: source english
+. $Work_Path/lang/lang_en_US_client_install
+# if locale is zh then source chinese
+echo $lang | grep 'zh' >> /dev/null && source $Work_Path/lang/lang_zh_TW_client_install
+
+# Ask language
+echo -e "\n$choose_lang_1"
+read -p "$choose_lang_2 " langChoice
+
+if [ $langChoice == "2" ]; then
+    source $Work_Path/lang/lang_zh_TW_client_install
+else
+    source $Work_Path/lang/lang_en_US_client_install
+fi
+}
+
+# 檢查執行這個程式的是否為root權限
+function check_root(){
+# 正式版後可拿掉此 echo
+  debug_info "check_root"
+  if [ $USER != "root" ]; then
+    show_info "$check_root_1"
+    exit
+  fi
+# 正式版後可拿掉此 echo
+  show_info "$check_root_2"
+}
+
+
+# 查出此主機的作業系統,以及版本
+function check_systemInfo(){
+  debug_info "$check_sys_1"
+  show_info "$check_sys_2"
+  Linux_Distribution=$(lsb_release -a 2> /dev/null | grep "Distributor ID:" | awk '{print $3}')
+  Linux_Version=$(lsb_release -a 2> /dev/null | grep "Release" | awk '{print $2}')
+  show_info "$Linux_Distribution , $Linux_Version"
+}
+
+
+# 安裝需要的相依套件 (目前只支援 deb 套件的系統自動安裝，yum或其他套件系統的則需手動安裝)
+function install_packages(){
+  # deb 系列系統
+  debug_info "$install_pack_1"
+  debug_info "$install_pack_2"
+  if [ "$Linux_Distribution" == "Ubuntu" ] || [ "$Linux_Distribution" == "Debian" ] ;then
+    echo -e "\n$install_pack_if_1\n"
+    aptitude install -y expect ssh dialog
+  # rpm 系列系統
+  elif [ "$Linux_Distribution" == "Fedora" ] || [ "$Linux_Distribution" == "CentOS" ] ;then
+    show_info "$install_pack_if_2"
+  else
+    show_info "$install_pack_if_2"
+  fi 
+}
+
+
+# 檢查之前是否有安裝NutchEz
+# 目前先檢查是否有/opt/nutchez 這個資料夾即可
+function check_nez_installed(){
+  debug_info "$check_nez_1"
+  if [ -d "opt/nutchez" ]; then
+    show_info "$check_nez_2"
+    exit
+  else
+    show_info "$check_nez_3"
+  fi
+}
+
+
+# 檢查是否有安裝sun java ,並檢查是否為jdk 1.6 以上版本
+# 4種判斷可能性 (1)系統沒安裝 JAVA (2)系統有安裝JAVA，但非sun版本 
+# (3)系統有安裝但Sun Java 在非預設路徑下 (4)以正確安裝 Sun JAVA 預設路徑下
+function check_sunJava(){
+  debug_info "$check_sunJava_1"
+  debug_info "$check_sunJava_2"
+
+  javaPath="/usr"
+  yesno="no"
+  choice="3"
+
+  if [ -e $javaPath/bin/java ]; then
+    JAVA_org=$($javaPath/bin/java -version 2>&1 | grep "Java(TM)")
+    JAVA_version=$($javaPath/bin/java -version 2>&1 | grep "java version" | \
+    awk '{print $3}' | cut -d "." -f1-2 | cut -d "\"" -f2)
+   
+  if [ "$JAVA_org" == "" ]; then 
+    show_info "$check_sunJava_if_1"
+    show_info "$check_sunJava_if_2"
+    show_info "$check_sunJava_if_3"
+    read -p "$check_sunJava_if_4" choice
+    case $choice  in
+      "1")
+        show_info "$check_sunJava_if_5"
+        exit 
+        ;;
+      "2")
+        read -p "$check_sunJava_if_6" javaPath
+        ;;
+        "*")
+        exit
+        ;;
+        esac
+
+        if [ $choice == "2" ]; then
+          JAVA_org=$($javaPath/bin/java -version 2>&1 | grep "Java(TM)")
+          JAVA_version=$($javaPath/bin/java -version 2>&1 | grep "java version" | \
+          awk '{print $3}' | cut -d "." -f1-2 | cut -d "\"" -f2)
+              
+          if [ "$JAVA_org" == "" ]; then
+            show_info "$check_sunJava_if_7"
+            exit
+            fi
+          fi
+        fi  
+
+      large16=$(echo "$JAVA_version >= 1.6" | bc)
+      if [ "${large16}" == 0 ]; then
+        show_info "$check_sunJava_if_8"
+        exit
+      fi  
+      
+      show_info "$check_sunJava_if_9"
+  else
+    show_info "$check_sunJava_if_10"
+    exit
+  fi
+
+  unset JAVA_org
+  unset JAVA_version
+}
+
+
+# 檢查是否有安裝openssh, openssh-server
+function check_ssh(){
+  debug_info "$check_ssh_1"
+  if [ -e /usr/bin/ssh ]; then
+    show_info "$check_ssh_2"
+  else
+    show_info "$check_ssh_3"
+    exit
+  fi
+
+  if [ -e /usr/sbin/sshd ]; then
+    show_info "$check_ssh_4"
+  else
+    show_info "$check_ssh_5"
+    exit
+  fi
+}
+
+
+# 檢查是否有安裝dialog
+function check_dialog(){
+  debug_info "$check_dialog_1"
+  if [ -e /usr/bin/dialog ]; then
+    show_info "$check_dialog_2"
+  else
+    show_info "$check_dialog_3"
+    exit
+  fi
+}
+
+
+# scp nutchuser@master_ip:~ 把.ssh/目錄複製下來
+# 當使用者輸入nutchuser 密碼時，將此密碼紀錄到Nutchuser_Passwd
+# 此步驟若無法連到 master 則跳出
+function scp_master_nutchuser_sshkey(){
+  debug_info "$scp_sshkey_d1"
+  debug_info "$scp_sshkey_d2"
+  mkdir -p /home/nutchuser/.ssh/
+  rm -fr /home/nutchuser/.ssh/*
+  unset Nutchuser_Passwd2
+
+  debug_info "$scp_sshkey_d3"
+expect -c "spawn scp -r -o StrictHostKeyChecking=no nutchuser@$1:~/.ssh /home/nutchuser/
+set timeout 1
+sleep 2
+expect \"*: \" { send \"$Nutchuser_Passwd\r\" }
+expect \"*: \" { send_user \"$scp_sshkey_expect_1\" }
+expect eof"
+
+  if [ -e "/home/nutchuser/.ssh/authorized_keys" ]; then
+    show_info "$scp_sshkey_s1"    
+    else
+      show_info "$scp_sshkey_s2"
+    exit
+  fi
+  ssh-add /home/nutchuser/.ssh/id_rsa
+  debug_info "$scp_sshkey_d4"
+  chown -R nutchuser:nutchuser /home/nutchuser/.ssh
+}
+
+# 新增nutchuser 帳號時用 Nutchuser_Passwd 當密碼
+function creat_nutchuser_account(){
+  debug_info "$create_nutchuser_d1"
+  while [ "$Nutchuser_Passwd" != "$Nutchuser_Passwd2" ]
+  do
+      echo -e "\n"
+      read -sp "$create_nutchuser_1" Nutchuser_Passwd
+      echo 
+      read -sp "$create_nutchuser_2" Nutchuser_Passwd2
+      echo 
+        if [ "$Nutchuser_Passwd" == "$Nutchuser_Passwd2" ]; then
+          show_info "$create_nutchuser_3"
+        else
+          show_info "$create_nutchuser_4"
+        fi
+  done                                                                                                                                    
+  unset Nutchuser_Passwd2
+
+  if [ $(cat /etc/passwd | grep nutchuser) ]; then
+    show_info "$create_nutchuser_s1"
+    expect -c "spawn passwd nutchuser
+    set timeout 1
+    expect \"*: \"
+    send \"$Nutchuser_Passwd\r\"
+    expect \"*: \"
+    send \"$Nutchuser_Passwd\r\"
+    expect eof"
+    else
+      show_info "$create_nutchuser_s2"
+      useradd -m nutchuser -s /bin/bash
+      expect -c "spawn passwd nutchuser
+      set timeout 1
+      expect \"*: \"
+      send \"$Nutchuser_Passwd\r\"
+      expect \"*: \"
+      send \"$Nutchuser_Passwd\r\"
+      expect eof"
+  fi
+}
+
+# 用scp 複製 master 的設定與安裝資料
+# 目前僅需做到能無礙的複製遠端的/opt/nutchez/到local的/opt/
+function scp_packages(){
+  debug_info "$scp_packages_d1"
+  mkdir /opt/nutchez
+  mkdir /var/nutchez
+  mkdir /home/nutchuser/nutchez
+  mkdir /home/nutchuser/nutchez/source
+  mkdir /home/nutchuser/nutchez/system
+  chmod 777 /opt/nutchez
+  debug_info "$scp_packages_d2"
+  chown -R nutchuser:nutchuser /opt/nutchez
+  chown -R nutchuser:nutchuser /var/nutchez
+  chown -R nutchuser:nutchuser /home/nutchuser/nutchez
+  chmod 755 /opt/nutchez
+  debug_info "$scp_packages_d3"
+  su nutchuser -c "scp -r -o StrictHostKeyChecking=no nutchuser@$1:/home/nutchuser/nutchez/source/NutchezForClientOf_$Master_IP_Address.tar.gz /home/nutchuser/nutchez/source"
+
+}
+
+
+function install_nutch_package(){
+  debug_info "$install_nutch_package_d1"
+  tar -zxvf /home/nutchuser/nutchez/source/NutchezForClientOf_$Master_IP_Address.tar.gz -C /opt/nutchez
+  cp /etc/hosts /home/nutchuser/nutchez/system/hosts.bak
+  sed -i '1a '$Master_IP_Address' '$Master_Hostname'' /etc/hosts
+  #/opt/nutchez/nutch/bin/hadoop-daemon.sh start datanode
+  #/opt/nutchez/nutch/bin/hadoop-daemon.sh start tasktracker
+}
+
+function recall_hostname_ip(){
+  debug_info "$recall_hostname_ip_d1"
+  net_interfaces=$(ifconfig | grep ^eth | cut -d " " -f1)
+  net_nu=$(echo $net_interfaces | wc -w)
+  # 若只有一個 eth　時
+  if [ "$net_nu" == "1" ]; then
+  # ifconfig $net_interfaces | grep "inet addr:" | sed 's/^.*inet addr://g' | cut -d " " -f1
+  net_address=$(ifconfig $net_interfaces | grep "inet addr:" | sed 's/^.*inet addr://g' | cut -d " " -f1)
+  net_MacAddr=$(ifconfig $net_interfaces | grep 'HW' | sed 's/^.*HWaddr //g')
+  show_info "$recall_hostname_ip_1 $net_address"
+  show_info "$recall_hostname_ip_2 $net_MacAddr"
+
+  # 若有多個 eth 時
+    else
+      declare -i i=1
+      show_info "$recall_hostname_ip_3"
+       
+      for net in $net_interfaces
+      do  
+        echo "($i)  $net  $(ifconfig $net | grep "inet addr:" | sed 's/^.*inet addr://g' | cut -d " " -f1)"
+        i=i+1
+      done
+       
+      read -p "$recall_hostname_ip_4" net_choice
+  if [ -z $net_choice ]; then
+    net_choice=1
+  fi   
+
+  show_info "choice is $net_choice"
+  net_interface=$(echo $net_interfaces | cut -d " " -f $net_choice)
+  # config $net_interface | grep "inet addr:" | sed 's/^.*inet addr://g' | cut -d " " -f1
+  net_address=$(ifconfig $net_interface | grep "inet addr:" | sed 's/^.*inet addr://g' | cut -d " " -f1)
+  net_MacAddr=$(ifconfig $net_interface | grep 'HW' | sed 's/^.*HWaddr //g') 
+  show_info "$recall_hostname_ip_1 $net_address"
+  show_info "$recall_hostname_ip_2 $net_MacAddr"
+  fi
+
+  debug_info "$recall_hostname_ip_d2"
+  su nutchuser -c "ssh nutchuser@$1 echo $net_address $(hostname) $net_MacAddr \>\> ~/nutchez/system/nutch_nodes"
+
+#su nutchuser -c expect -c "spawn ssh nutchuser@$1
+#set timeout 1
+#expect \"*\"
+#send \"echo $net_address $(hostname) >> /home/nutchuser/nutch_nodes\r\"
+#expect \"*\"
+#send \"exit\""
+}
Index: /nutchez-0.2/src/shell/client_remove.sh
===================================================================
--- /nutchez-0.2/src/shell/client_remove.sh	(revision 217)
+++ /nutchez-0.2/src/shell/client_remove.sh	(revision 217)
@@ -0,0 +1,100 @@
+#!/bin/bash
+# Program:
+#   remove shell script for client uninstall
+# Author:
+#   Waue, Shunfa, Rock {waue, shunfa, rock}@nchc.org.tw
+# Version:
+#    1.0
+# History:
+#    
+
+
+source ./lang_link
+# 需要 master_install 設定的參數區
+# Master IP here
+Master_IP_Address=input.your.master.ip_address
+# Master Hostname here
+Master_Hostname=input_your_master_hostname
+
+##########  echo function  ##########
+function debug_info () {
+  if [ $? -eq 0 ]; then
+    echo -e "\033[1;35;40m info - $1 \033[0m"
+  fi
+}
+
+
+function show_info () {
+  if [ $? -eq 0 ]; then
+    echo -e "\033[1;32;40m $1 \033[0m"
+  fi
+}
+##########end echo function ##########
+
+# check root
+function check_root(){
+  debug_info "check_root"
+  if [ $USER != "root" ]; then
+    show_info "$CR_check_root_1" # "請切換成 root 身份執行移除程式!!!"
+    exit
+  fi
+  show_info "$CR_check_root_2" # "已確認為root身份, 將繼續執行此移除程式！"
+}
+
+# shutdown service
+function shutdown_service () {
+  show_info "$CR_shutdown_service_echo_1" # "關閉本機服務..."
+  su nutchuser -c "/opt/nutchez/nutch/bin/hadoop-daemon.sh stop datanode"
+  su nutchuser -c "/opt/nutchez/nutch/bin/hadoop-daemon.sh stop tasktracker"
+  show_info "$CR_shutdown_service_echo_2" # "本機服務已關閉"
+}
+
+# 移除檔案及資料夾
+function remove_folders () {
+  show_info "$CR_remove_folders_echo_1" # "正在刪除安裝時所建立的檔案及資料夾..."
+  rm -rf /opt/nutchez
+  rm -rf /var/nutchez
+  show_info "$CR_remove_folders_echo_2" # "安裝時所建立的檔案及資料夾已刪除"
+}
+
+
+# 還原/etc/hosts
+function edit_hosts () {
+  show_info "$CR_edit_hosts_echo_1" # "修改/etc/hosts..."
+#  Line_NO=`cat /etc/hosts | grep -n $Master_IP_Address | sed 's/:.*//g'`
+#  if [[ $Line_NO -ge 1 ]]; then
+#    sed -i ''$Line_NO'd' /etc/hosts
+#  fi
+  cat > /etc/hosts < /home/nutchuser/nutchez/system/hosts.bak
+  show_info "$CR_edit_hosts_echo_2" # "完成修改/etc/hosts"
+}
+
+
+# 移除使用者
+function user_delete () {
+  show_info "$CR_user_delete_echo_1" # "正在刪除nutchuser使用者..."
+  userdel -r nutchuser
+  show_info "$CR_user_delete_echo_2" # "使用者nutchuser已刪除"
+}
+
+# Main function
+function main () {
+  show_info "$CR_main_echo_1" #"警告 - 此一程式為移除此用戶端的nutch node, 若您為誤執行此一程式, 請按Ctrl+c離開此程序！"
+  show_info "$CR_main_echo_2" #"本執行程序將會移除安裝nutchEZ時所新增的檔案及nutchuser使用者帳號"
+# 詢問是否繼續
+  read -p "$CR_main_echo_3" confirm # "請問是否確定移除此一節點：1.確定 2.取消"
+# 確認移除
+  if [ $confirm -eq 1 ]; then
+    check_root
+    shutdown_service
+    remove_folders
+    edit_hosts
+    user_delete
+    show_info "$CR_main_echo_4" # "移除程序已完成！"
+  elif [ $confirm -eq 2 ]; then
+    show_info "$CR_main_echo_5" # "您已取消移除程序！"
+    show_info "$CR_main_echo_6" # "若要移除請再重新執行！"
+  fi
+}
+
+main
Index: /nutchez-0.2/src/shell/duplicate_del
===================================================================
--- /nutchez-0.2/src/shell/duplicate_del	(revision 217)
+++ /nutchez-0.2/src/shell/duplicate_del	(revision 217)
@@ -0,0 +1,48 @@
+#!/bin/bash
+# Program:
+#   Delete duplicating ip $ hostname in file (for nutchez management interface).
+# Author: 
+#   Waue, Shunfa, Rock {waue, shunfa, rock}@nchc.org.tw
+# Version:
+#    1.0
+# History:
+#   2010/06/07  Rock    First release (1.0)
+
+# Delete duplicating ip addresss in file
+IPs=$(cat $1 | grep -v 'ip6' | grep -v '#' | grep -v '^$' | awk '{print $1}')
+
+# 刪掉空白行
+#sed -i '/^$/d' "$1"
+
+cp -f "$1" "${1}.old"
+#read -p "cp - f $1 ${1}.old ; $?"
+
+for ip_add in $(echo $IPs)
+do
+    ip_nu=$(cat -n $1 | grep $ip_add | awk '{print $1}')
+    ip_count=$(echo $ip_nu | wc -w)
+  
+    for (( i=1; i<${ip_count}; i++ ))
+    do
+        del_line=$(echo $ip_nu | cut -d " " -f${i})
+        sed -i "${del_line}d" $1
+    done
+done
+  
+# Dlete duplicating hostname in file
+hostnames=$(cat $1 | grep -v ip6 | grep -v '#' | grep -v '^$' |awk '{print $2}')
+for host in $(echo $hostnames)
+do
+    # line numbers
+    host_nu=$(cat -n $1 | grep "$host\$" | awk '{print $1}')
+    host_count=$(echo $host_nu | wc -w)
+  
+    for (( i=1; i<${host_count}; i++ ))
+    do
+        del_line=$(echo $host_nu | cut -d " " -f${i})
+        sed -i "${del_line}d" $1
+    done                                                                                                                                                             
+done
+
+cp -f "$1" "${1}.bak"
+#read -p "cp -f $1 ${1}.bak ; $?"
Index: /nutchez-0.2/src/shell/install
===================================================================
--- /nutchez-0.2/src/shell/install	(revision 217)
+++ /nutchez-0.2/src/shell/install	(revision 217)
@@ -0,0 +1,71 @@
+#!/bin/bash
+#
+
+# 變數宣告
+Work_Path="./"
+Work_Path_J=0
+
+# Work Path setup
+echo $0 | grep '/' || Work_Path_J=1
+if [ "$Work_Path_J" == "0"  ]; then
+    Work_Path=$(echo $0 | sed 's/install//')
+fi
+
+# Source functions
+source $Work_Path/install_func.sh
+source $Work_Path/lang_link
+### real code #####
+
+# 前置作業
+# *.sh及nutchez-0.2-0531.tar.gz均在同一目錄下
+
+function show_info () {
+  if [ $? -eq 0 ]; then
+    echo -e "\033[1;32;40m $1 \033[0m"
+  fi
+}
+
+main () {
+  check_info
+  show_info "$MI_main_echo_1"
+# show_info "歡迎使用NutchEZ, 此安裝程序會為您新建一個nutchuser帳號並協助您設定密碼"
+  set_install_information
+  show_master_info
+  read -p "$MI_main_echo_2" confirm
+# read -p "Please confirm your install infomation: 1.Yes 2.No  " confirm
+  if [ $confirm -eq 1 ]; then
+    creat_nutchuser_account $Nutchuser_Passwd
+    make_ssh_key
+    # 解壓縮
+    tar -zxvf nutchezV2-current.tar.gz -C /opt/
+
+    su nutchuser -c "mkdir /home/nutchuser/nutchez"
+    su nutchuser -c "mkdir /home/nutchuser/nutchez/urls"
+    su nutchuser -c "touch /home/nutchuser/nutchez/urls/urls.txt"
+    su nutchuser -c "mkdir /home/nutchuser/nutchez/search"
+    su nutchuser -c "mkdir /home/nutchuser/nutchez/source"
+    su nutchuser -c "mkdir /home/nutchuser/nutchez/system"   
+
+    Install_Nutch
+
+    mkdir /var/nutchez
+    chown -R nutchuser:nutchuser /opt/nutchez
+    chown -R nutchuser:nutchuser /var/nutchez
+
+    make_client_install
+    # 啟動系統
+    format_HDFS
+    start_up_NutchEZ
+    start_up_tomcat    
+    # 安裝流程結束，並進入網頁管理頁面設定爬網網址...等  
+    show_info "$MI_main_echo_3"
+#   show_info "Install Successfully!!"
+    show_info "$MI_main_echo_4"
+#   show_info "Visit http://$MasterIP_Address:8080"
+    client_install_commands
+  elif [ $confirm -eq 2 ]; then
+    main
+  fi
+}
+
+main
Index: /nutchez-0.2/src/shell/install_func.sh
===================================================================
--- /nutchez-0.2/src/shell/install_func.sh	(revision 217)
+++ /nutchez-0.2/src/shell/install_func.sh	(revision 217)
@@ -0,0 +1,506 @@
+#!/bin/bash
+source $Work_Path/lang_link
+####### garbage here #############
+function mainFunction ( )
+{
+echo "$Good"
+}
+function braBraBra ( )
+{
+echo "$Bra_Bra_Bra"
+}
+####### garbage end ###############
+
+# shell檔及壓縮檔在同一目錄中
+
+####### 環境變數section###########
+User_HOME=/home/nutchuser/nutchez
+NutchEZ_HOME=/opt/nutchez
+Nutch_HOME=$NutchEZ_HOME/nutch
+Tomcat_HOME=$NutchEZ_HOME/tomcat
+Index_DB=$User_HOME/search
+Admin_email=nutchuser@nutch
+Start_PATH=`pwd`
+MasterIP_Address=`/sbin/ifconfig eth0 | grep 'inet addr' |  sed 's/^.*addr://g' | sed 's/Bcast.*$//g' | sed 's/ .*// '` 
+net_MacAddr=`/sbin/ifconfig eth0 | grep 'HW' | sed 's/^.*HWaddr //g'`
+
+######function section section#######
+
+##########  echo function  ##########
+function debug_info () {
+  if [ $? -eq 0 ]; then
+    echo -e "\033[1;35;40m info - $1 \033[0m"
+  fi
+}
+
+
+function show_info () {
+  if [ $? -eq 0 ]; then
+    echo -e "\033[1;32;40m $1 \033[0m"
+  fi
+}
+##########end echo function ##########
+
+function choose_lang(){
+
+lang=$(locale | grep 'LANG=' | cut -d "=" -f2)
+
+# Default: source english
+. $Work_Path/install_lang.en
+# if locale is zh then source chinese
+echo $lang | grep 'zh' >> /dev/null && source $Work_Path/install_lang.zh
+
+# Ask language
+echo -e "\n$choose_lang_1"
+read -p "$choose_lang_2 " langChoice
+
+if [ $langChoice == "2" ]; then
+    source $Work_Path/install_lang.zh
+else
+    source $Work_Path/install_lang.en
+fi
+}
+
+function check_root(){
+  debug_info "check_root"
+  if [ $USER != "root" ]; then
+    show_info "$MI_check_root_1"
+    exit
+  fi
+  show_info "$MI_check_root_2"
+}
+
+function check_systemInfo(){
+  debug_info "$MI_check_sys_1"
+  show_info "$MI_check_sys_2"
+  Linux_Distribution=$(lsb_release -a 2> /dev/null | grep "Distributor ID:" | awk '{print $3}')
+  Linux_Version=$(lsb_release -a 2> /dev/null | grep "Release" | awk '{print $2}')
+  show_info "$Linux_Distribution , $Linux_Version"
+}
+
+function install_packages(){
+  # deb 系列系統
+  debug_info "$MI_install_pack_1"
+  debug_info "$MI_install_pack_2"
+  if [ "$Linux_Distribution" == "Ubuntu" ] || [ "$Linux_Distribution" == "Debian" ] ;then
+    echo -e "\n$MI_install_pack_if_1\n"
+    aptitude install -y expect ssh dialog
+  # rpm 系列系統
+  elif [ "$Linux_Distribution" == "Fedora" ] || [ "$Linux_Distribution" == "CentOS" ] ;then
+    show_info "$MI_install_pack_if_2"
+  else
+    show_info "$MI_install_pack_if_2"
+  fi
+}
+
+function check_nez_installed(){
+  debug_info "$MI_check_nez_1"
+  if [ -d "/opt/nutchez" ]; then
+    show_info "$MI_check_nez_2"
+    exit
+  else
+    show_info "$MI_check_nez_3"
+  fi
+}
+
+function check_sunJava(){
+  debug_info "$MI_check_sunJava_1"
+  debug_info "$MI_check_sunJava_2"
+
+  javaPath="/usr"
+  yesno="no"
+  choice="3"
+
+  if [ -e $javaPath/bin/java ]; then
+    JAVA_org=$($javaPath/bin/java -version 2>&1 | grep "Java(TM)")
+    JAVA_version=$($javaPath/bin/java -version 2>&1 | grep "java version" | \
+    awk '{print $3}' | cut -d "." -f1-2 | cut -d "\"" -f2)
+
+  if [ "$JAVA_org" == "" ]; then
+    show_info "$MI_check_sunJava_if_1"
+    show_info "$MI_check_sunJava_if_2"
+    show_info "$MI_check_sunJava_if_3"
+    read -p "$MI_check_sunJava_if_4" choice
+    case $choice  in
+      "1")
+        show_info "$MI_check_sunJava_if_5"
+        exit
+        ;;
+      "2")
+        read -p "$MI_check_sunJava_if_6" javaPath
+        ;;
+        "*")
+        exit
+        ;;
+        esac
+
+        if [ $choice == "2" ]; then
+          JAVA_org=$($javaPath/bin/java -version 2>&1 | grep "Java(TM)")
+          JAVA_version=$($javaPath/bin/java -version 2>&1 | grep "java version" | \
+          awk '{print $3}' | cut -d "." -f1-2 | cut -d "\"" -f2)
+
+          if [ "$JAVA_org" == "" ]; then
+            show_info "$MI_check_sunJava_if_7"
+            exit
+            fi
+          fi
+        fi
+
+      large16=$(echo "$JAVA_version >= 1.6" | bc)
+      if [ "${large16}" == 0 ]; then
+        show_info "$MI_check_sunJava_if_8"
+        exit
+      fi
+
+      show_info "$MI_check_sunJava_if_9"
+  else
+    show_info "$MI_check_sunJava_if_10"
+    exit
+  fi
+
+  unset JAVA_org
+  unset JAVA_version
+}
+
+# 檢查是否有安裝openssh, openssh-server
+function check_ssh(){
+  debug_info "$MI_check_ssh_1"
+  if [ -e /usr/bin/ssh ]; then
+    show_info "$MI_check_ssh_2"
+  else
+    show_info "$MI_check_ssh_3"
+    exit
+  fi
+
+  if [ -e /usr/sbin/sshd ]; then
+    show_info "$MI_check_ssh_4"
+  else
+    show_info "$MI_check_ssh_5"
+    exit
+  fi
+}
+
+
+# 檢查是否有安裝dialog
+function check_dialog(){
+  debug_info "$MI_check_dialog_1"
+  if [ -e /usr/bin/dialog ]; then
+    show_info "$MI_check_dialog_2"
+  else
+    show_info "$MI_check_dialog_3"
+    exit
+  fi
+}
+
+check_info () {
+  check_root
+  check_systemInfo
+  install_packages
+  check_nez_installed
+  check_sunJava
+  check_ssh
+  check_dialog
+}
+
+function set_install_information () { 
+  set_nutchuser_passwd
+  select_eth
+  MasterIP_Address=$net_address
+}
+
+function set_nutchuser_passwd () {
+  read -sp "$MI_set_nutchuser_passwd_echo_1" Nutchuser_Passwd
+# read -sp "Please enter nutchuser's password :  " Nutchuser_Passwd
+  echo -e "\n"
+  read -sp "$MI_set_nutchuser_passwd_echo_2" Nutchuser_Passwd2
+# read -sp "Please enter nutchuser's password again:  " Nutchuser_Passwd2
+  echo -e "\n"
+  if [ $Nutchuser_Passwd != $Nutchuser_Passwd2 ]; then
+    set_nutchuser_passwd
+  fi
+}
+
+# 新增nutchuser 帳號時用 Nutchuser_Passwd 當密碼
+function creat_nutchuser_account(){
+  debug_info "$create_nutchuser_d1"
+  while [ "$Nutchuser_Passwd" != "$Nutchuser_Passwd2" ]
+  do
+      echo -e "\n"
+      read -sp "$create_nutchuser_1" Nutchuser_Passwd
+      echo 
+      read -sp "$create_nutchuser_2" Nutchuser_Passwd2
+      echo 
+        if [ "$Nutchuser_Passwd" == "$Nutchuser_Passwd2" ]; then
+          show_info "$create_nutchuser_3"
+        else
+          show_info "$create_nutchuser_4"
+        fi
+  done                                                                                                                         
+  unset Nutchuser_Passwd2
+
+  if [ $(cat /etc/passwd | grep nutchuser) ]; then
+    show_info "$create_nutchuser_s1"
+    expect -c "spawn passwd nutchuser
+    set timeout 1
+    expect \"*: \"
+    send \"$Nutchuser_Passwd\r\"
+    expect \"*: \"
+    send \"$Nutchuser_Passwd\r\"
+    expect eof"
+    else
+      show_info "$create_nutchuser_s2"
+      useradd -m nutchuser -s /bin/bash
+      expect -c "spawn passwd nutchuser
+      set timeout 1
+      expect \"*: \"
+      send \"$Nutchuser_Passwd\r\"
+      expect \"*: \"
+      send \"$Nutchuser_Passwd\r\"
+      expect eof"
+  fi
+}
+
+function select_eth () {
+  net_interfaces=$(ifconfig | grep ^eth | cut -d " " -f1)
+  net_nu=$(echo $net_interfaces | wc -w)
+
+  # 若只有一個 eth　時
+  if [ "$net_nu" == "1" ]; then
+    net_address=$(ifconfig $net_interfaces | grep "inet addr:" | sed 's/^.*inet addr://g' | cut -d " " -f1)
+    net_MacAddr=$(ifconfig $net_interfaces | grep 'HW' | sed 's/^.*HWaddr //g')
+
+  # 若有多個 eth 時
+  else
+    declare -i i=1
+    show_info "$MI_select_eth_echo_1"
+#   show_info  "\nSystem have multiple network device, which network use for this machine: "
+
+    for net in $net_interfaces
+      do
+        show_info "($i)  $net  $(ifconfig $net | grep "inet addr:" | sed 's/^.*inet addr://g' | cut -d " " -f1)"
+        i=i+1
+      done
+      read -p "$MI_select_eth_echo_2" net_choice
+#     read -p "Please choice(1/2/3...): " net_choice
+    if [ -z $net_choice ]; then
+      net_choice=1
+    fi
+
+    show_info "$MI_select_eth_echo_3 $net_choice"
+#   show_info "Your choice is $net_choice"
+    net_interface=$(echo $net_interfaces | cut -d " " -f $net_choice)
+    #ifconfig $net_interface | grep "inet addr:" | sed 's/^.*inet addr://g' | cut -d " " -f1
+    net_address=$(ifconfig $net_interface | grep "inet addr:" | sed 's/^.*inet addr://g' | cut -d " " -f1)
+    net_MacAddr=$(ifconfig $net_interface | grep 'HW' | sed 's/^.*HWaddr //g')
+
+    show_info "$MI_select_eth_echo_4 $net_address"
+#   show_info "net_address is $net_address"
+    show_info "$MI_select_eth_echo_5 $net_MacAddr"
+#   show_info "net_MacAddr is $net_MacAddr"
+  fi
+}
+
+
+function show_master_info () {
+  show_info "$MI_show_master_info_echo_1 $MasterIP_Address"
+  show_info "$MI_show_master_info_echo_2 $net_MacAddr"
+
+#  show_info "The Master IP Address is $MasterIP_Address"
+#  show_info "The Master MacAddr is $net_MacAddr"
+}
+
+function make_ssh_key () {
+  debug_info "$MI_make_ssh_key_echo_1"
+# debug_info "Make ssh key(begin...)"
+  su nutchuser -c 'ssh-keygen -t rsa -f ~/.ssh/id_rsa -P ""'
+  su nutchuser -c "cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys"
+  su nutchuser -c "ssh-add /home/nutchuser/.ssh/id_rsa"
+  debug_info "$MI_make_ssh_key_echo_2"
+# debug_info "Make ssh key(done!)"
+}
+
+
+function set_haoop-site () {
+  debug_info "$MI_set_haoop_site_echo_1"
+# debug_info "set hadoop-site.xml(begin...)"
+  cd $Nutch_HOME/conf/
+  cat > hadoop-site.xml << EOF
+<configuration>
+  <property>
+    <name>fs.default.name</name>
+    <value>hdfs://$MasterIP_Address:9000</value>
+  </property>
+  <property>
+    <name>mapred.job.tracker</name>
+    <value>$MasterIP_Address:9001</value>
+  </property>
+  <property>
+    <name>hadoop.tmp.dir</name>
+    <value>/var/nutchez/nutch-nutchuser</value>
+  </property>
+</configuration>
+EOF
+  debug_info "$MI_set_haoop_site_echo_2"
+# debug_info "set hadoop-site.xml(done!)"
+}
+
+# 修改nutch-site.xml中-http.agent.url, http.agent.email
+function set_nutch-site () {
+  debug_info "$MI_set_nutch_site_echo_1"
+# debug_info "set nutch-site.xml(begin...)"
+  Line_NO=`cat $Nutch_HOME'/conf/nutch-site.xml' | grep -n 'http.agent.url' | sed 's/:.*//g'`
+  debug_info "$MI_set_nutch_site_echo_2"
+# debug_info "debug...http.agent.url line number = $Line_NO..."
+  sed -i ''$((Line_NO+1))'d' $Nutch_HOME/conf/nutch-site.xml
+  debug_info "$MI_set_nutch_site_echo_3"
+# debug_info "debug...edit http.agent.url delete line $((Line_NO+1))..."
+  sed -i ''$Line_NO'a <value>'$MasterIP_Address'</value>' $Nutch_HOME/conf/nutch-site.xml
+  debug_info "$MI_set_nutch_site_echo_4"
+# debug_info "debug...edit http.agent.url done..."
+
+  Line_NO=`cat $Nutch_HOME'/conf/nutch-site.xml' | grep -n 'http.agent.email' | sed 's/:.*//g'`
+  debug_info "$MI_set_nutch_site_echo_5"
+# debug_info "debug...http.agent.email line number = $Line_NO..."
+
+  sed -i ''$((Line_NO+1))'d' $Nutch_HOME/conf/nutch-site.xml
+  debug_info "$MI_set_nutch_site_echo_6"
+# debug_info "debug...edit http.agent.email delete line $((Line_NO+1))..."
+  sed -i ''$Line_NO'a <value>'$Admin_email'</value>' $Nutch_HOME/conf/nutch-site.xml
+  debug_info "$MI_set_nutch_site_echo_7"
+# debug_info "debug...edit http.agent.email done..."
+  debug_info "$MI_set_nutch_site_echo_8"
+# debug_info "set nutch-site.xml(done!)"
+}
+
+function format_HDFS () {
+  debug_info "$MI_format_HDFS_echo_1"
+  su nutchuser -c "$Nutch_HOME/bin/hadoop namenode -format"
+  debug_info "$MI_format_HDFS_echo_2"
+}
+
+function start_up_NutchEZ (){
+  debug_info "$MI_start_up_NutchEZ_echo_1"
+# debug_info "start up NutchEZ..."
+  su nutchuser -c "$Nutch_HOME/bin/start-all.sh"
+}
+
+
+function set_hosts () {
+  debug_info "$MI_set_hosts_echo_1"
+  cp /etc/hosts /home/nutchuser/nutchez/system/hosts.bak
+  Line_NO=`cat /etc/hosts | grep -n $(hostname) | sed 's/:.*//g'`
+  content=$(cat /etc/hosts | awk 'NR=='$Line_NO'{printf "# " ; print}' )
+  sed -i ""$Line_NO"c $content" /etc/hosts
+  sed -i '1i '$MasterIP_Address' '$(hostname)'' /etc/hosts
+}
+
+function Install_Nutch () {
+  debug_info "$MI_install_Nutch_echo_1 $MasterIP_Address "
+# debug_info "MasterIP_Address=$MasterIP_Address"
+  debug_info "$MI_install_Nutch_echo_2 $(hostname)"
+# debug_info "Master_Hostname=$(hostname)"
+  su nutchuser -c "echo $net_address $(hostname) $net_MacAddr \>\> ~/nutchez/system/nutch_nodes"
+  set_hosts
+  set_haoop-site
+  set_nutch-site
+}
+
+
+function client_PassMasterIPAddr () {
+  cd $Start_PATH
+  Line_NO=`cat client_install | grep -n '# Master IP here' | sed 's/:.*//g'`
+  debug_info "$MI_client_PassMasterIPAddr_echo_1"
+# debug_info "debug...Master IP here line number = $Line_NO..."
+  sed -i ''$((Line_NO+1))'d' client_install
+  debug_info "$MI_client_PassMasterIPAddr_echo_2"
+# debug_info "debug...edit Master IP at line $((Line_NO+1))..."
+  sed -i ''$Line_NO'a Master_IP_Address='$MasterIP_Address'' client_install
+  debug_info "$MI_client_PassMasterIPAddr_echo_3"
+# debug_info "edit client_install done..."
+}
+
+
+function client_PassMaster_Hostname () {
+  cd $Start_PATH
+  Line_NO=`cat client_install | grep -n '# Master Hostname here' | sed 's/:.*//g'`
+  debug_info "$MI_client_PassMaster_Hostname_echo_1"
+# debug_info "debug...Master hostname here line number = $Line_NO..."
+  sed -i ''$((Line_NO+1))'d' client_install
+  debug_info "$MI_client_PassMaster_Hostname_echo_2"
+# debug_info "debug...edit Master Hostname at line $((Line_NO+1))..."
+  sed -i ''$Line_NO'a Master_Hostname='$(hostname)'' client_install
+  debug_info "$MI_client_PassMaster_Hostname_echo_3"
+# debug_info "edit client_install done..."
+}
+
+function client_PassMasterIPAddr_for_Remove () {
+  cd $Start_PATH
+  Line_NO=`cat client_remove.sh | grep -n "# Master IP here" | sed 's/:.*//g'`
+  sed -i ''$((Line_NO+1))'d' client_remove.sh
+  sed -i ''$Line_NO'a Master_IP_Address='$MasterIP_Address'' client_remove.sh
+}
+
+
+function make_client_install () {
+  # 建立資料夾(用來存放client的安奘檔)
+  su nutchuser -c "mkdir $User_HOME/source"
+
+  # 將Master_IP_Address給client
+  # 打包安裝目錄(不含tomcat)
+ 
+  debug_info "$MI_make_client_install_echo_1"
+# debug_info "function make_client_install..."
+
+  client_PassMasterIPAddr
+  client_PassMaster_Hostname
+  client_PassMasterIPAddr_for_Remove
+  cd /opt/nutchez/
+  su nutchuser -c "tar -cvzf NutchezForClientOf_$MasterIP_Address.tar.gz  nutch"
+  
+  # 複製檔案至$User_HOME/source目錄下
+  mv NutchezForClientOf_$MasterIP_Address.tar.gz /home/nutchuser/nutchez/source
+  cp $Start_PATH/client_install $Start_PATH/client_install_func.sh $Start_PATH/client_remove.sh $Start_PATH/lang_link  /home/nutchuser/nutchez/source
+  cp -r $Start_PATH/lang /home/nutchuser/nutchez/source
+  cp -r $Start_PATH/lang /home/nutchuser/nutchez/system
+  cp $Start_PATH/nutchez $Start_PATH/lang_link $Start_PATH/add_hosts $Start_PATH/duplicate_del $Start_PATH/master_remove.sh /home/nutchuser/nutchez/system
+
+#  cp $Start_PATH/client_install $Start_PATH/client_install /home/nutchuser/nutchez/source
+#  cp $Start_PATH/client_install $Start_PATH/client_remove.sh /home/nutchuser/nutchez/source
+#  cp $Start_PATH/client_install $Start_PATH/lang* /home/nutchuser/nutchez/source
+}
+
+function start_up_tomcat () {
+  debug_info "$MI_start_up_tomcat_echo_1"
+# debug_info "start up tomcat..."
+
+  i=10
+  debug_info "$MI_start_up_tomcat_echo_2"
+  until [ $i -lt 1 ]
+    do
+      sleep 1s
+      i=`expr $i - 1`
+    done
+  su nutchuser -c "$Tomcat_HOME/bin/startup.sh"
+  debug_info "$MI_start_up_tomcat_echo_3"
+# debug_info "tomcat has been started..."
+}
+
+###最後再整理###
+# client簡易步驟
+function client_install_commands () {
+  show_info "$MI_client_install_commands_echo_1"
+  show_info "$MI_client_install_commands_echo_2"
+  show_info "$MI_client_install_commands_echo_3"
+  show_info "$MI_client_install_commands_echo_4"
+  show_info "$MI_client_install_commands_echo_5"
+  show_info "$MI_client_install_commands_echo_6"
+  show_info "$MI_client_install_commands_echo_7"
+
+#  show_info "Client Install Command as Follows:"
+#  show_info "cd ~"
+#  show_info "mkdir nutchez_client_install"
+#  show_info "cd nutchez_client_install"
+#  show_info "scp nutchuser@$MasterIP_Address:/home/nutchuser/nutchez/source/* ."
+#  show_info "sudo su"
+#  show_info "./client_install"
+}
Index: /nutchez-0.2/src/shell/lang/install_lang
===================================================================
--- /nutchez-0.2/src/shell/lang/install_lang	(revision 217)
+++ /nutchez-0.2/src/shell/lang/install_lang	(revision 217)
@@ -0,0 +1,1 @@
+link ./install_lang.zh
Index: /nutchez-0.2/src/shell/lang/install_lang.en
===================================================================
--- /nutchez-0.2/src/shell/lang/install_lang.en	(revision 217)
+++ /nutchez-0.2/src/shell/lang/install_lang.en	(revision 217)
@@ -0,0 +1,2 @@
+Good="Check Over jifowjef;jwf;aijf";
+Bra_Bra_Bra="ok, we install..."
Index: /nutchez-0.2/src/shell/lang/install_lang.zh
===================================================================
--- /nutchez-0.2/src/shell/lang/install_lang.zh	(revision 217)
+++ /nutchez-0.2/src/shell/lang/install_lang.zh	(revision 217)
@@ -0,0 +1,137 @@
+#!/bin/bash
+# Program:
+#   Chinese Language file for client_install
+# Author:
+#   Waue, Shunfa, Rock {waue, shunfa, rock}@nchc.org.tw
+# Version:
+#    1.0
+# History:
+#
+
+
+## Lang for master_install ##
+main_echo_1="歡迎使用NutchEZ, 此安裝程序會為您新建一個nutchuser帳號並協助您設定>密碼"
+main_echo_2="請確認上述的安裝資訊：1.正確 2.不正確"
+main_echo_3="安裝成功！"
+main_echo_4="請進入管理頁面：http://$MasterIP_Address:8080"
+
+## Lang for master_install_func.sh ##
+### [for choose_lang()] ### 
+choose_lang_1="請選擇語言: (1)English (2)中文" 
+choose_lang_2="(1/2):" 
+
+### [for check_root()]### 
+check_root_1="請切換成 root 身份執行!!!" 
+check_root_2="身份是 root" 
+ 
+### [for check_systemInfo()]### 
+check_sys_1="check_systemInfo" 
+check_sys_2="作業系統為: " 
+ 
+### [for install_packages()]### 
+install_pack_1="install_packages" 
+install_pack_2="檢查套件相依性" 
+install_pack_if_1="將會安裝 expect, ssh 和 dialog　套件" 
+install_pack_if_2="請手動安裝 expect, ssh 和 dialog 套件" 
+ 
+### [for check_nez_installed()] ### 
+check_nez_1="chcheck_nez_installed" 
+check_nez_2="系統先前已安裝NutchEz" 
+check_nez_3="系統尚未安裝 NutchEz" 
+ 
+### [for check_sunJava()] ### 
+check_sunJava_1="check_sunJava" 
+check_sunJava_2="NutchEz 需要 Sun Java JDK 1.6 以上的版本" 
+check_sunJava_if_1="Java 並不是 Sun　版本, 請自行安裝 Sun 版本的 Java" 
+check_sunJava_if_2="請輸入您的選擇: " 
+check_sunJava_if_3="(1)系統沒有 Sun Java (2)Sun Java已安裝並於其他路徑 (3)結束" 
+check_sunJava_if_4="請選擇 (1/2/3): " 
+check_sunJava_if_5="請自行安裝 Sun Java 1.6 以上版本" 
+check_sunJava_if_6="請輸入 Sum Java 的家路徑 (例如： '/usr/lib/jvm/java-6-sun-1.6.0.12'): " 
+check_sunJava_if_7="Java 並不是 Sun　版本, 請自行安裝 Sun 版本的 Java" 
+check_sunJava_if_8="Java 版本太舊 (請更新至 1.6　以上版本)" 
+check_sunJava_if_9="系統有 Sun Java 1.6 以上版本" 
+check_sunJava_if_10="請自行安裝 Sun Java 1.6 以上版本" 
+ 
+### [for check_ssh()] ### 
+check_ssh_1="check_ssh" 
+check_ssh_2="系統已有 ssh." 
+check_ssh_3="請安裝 ssh." 
+check_ssh_4="系統已有 ssh Server (sshd)." 
+check_ssh_5="請安裝 ssh Server (sshd)." 
+ 
+### [for check_dialog()] ### 
+check_dialog_1="check_dialog" 
+check_dialog_2="系統已有 dialog." 
+check_dialog_3="請安裝 dialog." 
+	 	 
+#
+set_nutchuser_passwd_echo_1="請輸入欲設定的nutchuser密碼："
+set_nutchuser_passwd_echo_2="請再輸入一次確認密碼："
+
+#
+select_eth_echo_1="系統偵測到目前擁有網卡如下："
+select_eth_echo_2="請選擇欲給nutchez使用的網卡(1/2/3)："
+select_eth_echo_3="您選擇的網卡為：$net_choice"
+select_eth_echo_4="Master網路IP位址為：$net_address"
+select_eth_echo_5="Master的MAC為：$net_MacAddr"
+
+#
+make_ssh_key_echo_1="正在產生SSH Key... "
+make_ssh_key_echo_2="SSH Key已產生"
+
+#
+set_haoop_site_echo_1="正在設定hadoop-site.xml... "
+set_haoop_site_echo_2="hadoop-site.xml設定完成"
+
+#
+set_nutch_site_echo_1="正在設定nutch-site.xml..."
+set_nutch_site_echo_2="http.agent.url 設定行號為：$Line_NO..."
+set_nutch_site_echo_3="編輯http.agent.url, 刪除行號 $Line_NO."
+set_nutch_site_echo_4="編輯http.agent.url完成"
+set_nutch_site_echo_5="http.agent.email 設定行號為：$Line_NO."
+set_nutch_site_echo_6="編輯http.agent.email, 刪除行號 $Line_NO."
+set_nutch_site_echo_7="編輯http.agent.email完成"
+set_nutch_site_echo_8="hadoop-site.xml設定完成"
+
+#
+format_HDFS_echo_1="格式化HDFS..."
+format_HDFS_echo_2="格式化HDFS完成"
+
+#
+start_up_NutchEZ_echo_1="啟動NutchEZ..."
+
+#
+set_hosts_echo_1="設定master上的hosts"
+
+#
+install_Nutch_echo_1="Master的IP位址為："
+install_Nutch_echo_2="Master的Hostname為："
+
+#
+client_PassMasterIPAddr_echo_1="在client安裝檔修改MasterIP的行號: $Line_NO"
+client_PassMasterIPAddr_echo_2="編輯MasterIP..."
+client_PassMasterIPAddr_echo_3="完成編輯MasterIP."
+
+#
+client_PassMaster_Hostname_echo_1="在client安裝檔修改Hostname, 行號為: $Line_NO"
+client_PassMaster_Hostname_echo_2="編輯Hostname..."
+client_PassMaster_Hostname_echo_3="完成編輯Hostname."
+
+#
+make_client_install_echo_1="於function make_client_install ..."
+
+#
+start_up_tomcat_echo_1="啟動tomcat..."
+start_up_tomcat_echo_2="等待 $i 秒..."
+start_up_tomcat_echo_3="tomcat 已經啟動！"
+
+#
+client_install_commands_echo_1="Client安裝可參考以下指令："
+client_install_commands_echo_2="cd ~"
+client_install_commands_echo_3="mkdir nutchez_client_install"
+client_install_commands_echo_4="cd nutchez_client_install"
+client_install_commands_echo_5="scp nutchuser@$MasterIP_Address:/home/nutchuser/nutchez/source/* ."
+client_install_commands_echo_6="sudo su"
+client_install_commands_echo_7="./client_install"
+
Index: /nutchez-0.2/src/shell/lang/lang_en_US
===================================================================
--- /nutchez-0.2/src/shell/lang/lang_en_US	(revision 217)
+++ /nutchez-0.2/src/shell/lang/lang_en_US	(revision 217)
@@ -0,0 +1,386 @@
+#!/bin/bash
+# Program:
+#   Chinese Language file for NutchEZ 
+# Author:
+#   Waue, Shunfa, Rock {waue, shunfa, rock}@nchc.org.tw
+# Version:
+#    1.0
+# History:
+#
+
+############ Lang for master_install -Start ############
+MI_main_echo_1="Welcome to use NutchEZ, this install program will create a new accunt and to assist you to setup the password of nutchuser."
+MI_main_echo_2="Please confirm the install infomation of above ：1.Yes 2.No "
+MI_main_echo_3="Installed successfully!"
+MI_main_echo_4="You can visit the manage website ：http://$MasterIP_Address:8080"
+
+## Lang for master_install_func.sh ##
+### [for choose_lang()] ### 
+MI_choose_lang_1="Please select a language: (1)English (2)中文" 
+MI_choose_lang_2="Use (1/2):" 
+
+### [for check_root()]### 
+MI_check_root_1="Please change root to execute it!!!" 
+MI_check_root_2="Identify is root" 
+ 
+### [for check_systemInfo()]### 
+MI_check_sys_1="check_systemInfo" 
+MI_check_sys_2="Your system information is:" 
+
+### [for install_packages()]### 
+MI_install_pack_1="install_packages" 
+MI_install_pack_2="Check dependent packages" 
+MI_install_pack_if_1="It will install some packages (expect, ssh, and dialog)." 
+MI_install_pack_if_2="Please manually install expect, ssh, and dialog.Please manually install expect, ssh, and dialog." 
+ 
+### [for check_nez_installed()] ### 
+MI_check_nez_1="chcheck_nez_installed" 
+MI_check_nez_2="System already had NutchEz." 
+MI_check_nez_3="System does not has NutchEz." 
+ 
+### [for check_sunJava()] ### 
+MI_check_sunJava_1="check_sunJava" 
+MI_check_sunJava_2="NutchEz need Sun Java JDK 1.6.x or above version" 
+MI_check_sunJava_if_1="Java is not Sun version, plz install sun Java 1.6.X" 
+MI_check_sunJava_if_2="Please input your choice:" 
+MI_check_sunJava_if_3="(1)System don't have Sun Java (2)Sun Java is in other path (3)Exit" 
+MI_check_sunJava_if_4="Use (1/2/3): " 
+MI_check_sunJava_if_5="Please install Sun Java manually!" 
+MI_check_sunJava_if_6="Input Sun Java home path(ex. '/usr/lib/jvm/java-6-sun-1.6.0.12' or using default '/usr' ): " 
+MI_check_sunJava_if_7="It is not Sun Java! Please install Sun Java manually !" 
+MI_check_sunJava_if_8="Java version is too old (it need 1.6.X above)"
+MI_check_sunJava_if_9="System has Sun Java 1.6 above version." 
+MI_check_sunJava_if_10="Please install Sun JAVA 1.6.X or above version" 
+ 
+### [for check_ssh()] ### 
+MI_check_ssh_1="check_ssh" 
+MI_check_ssh_2="System has ssh." 
+MI_check_ssh_3="Please install ssh." 
+MI_check_ssh_4="System has ssh Server (sshd)." 
+MI_check_ssh_5="Please install ssh Server (sshd)." 
+ 
+### [for check_dialog()] ### 
+MI_check_dialog_1="check_dialog" 
+MI_check_dialog_2="System has dialog." 
+MI_check_dialog_3="Please install dialog." 
+	 	 
+#
+MI_set_nutchuser_passwd_echo_1="Set password for nutchuser："
+MI_set_nutchuser_passwd_echo_2="keyin the password again："
+
+#
+MI_select_eth_echo_1="System has detectable network cards as follows:"
+MI_select_eth_echo_2="Please choose a netword card for NutchEZ. Use (1/2/3)："
+MI_select_eth_echo_3="Your choose is：$net_choice"
+MI_select_eth_echo_4="Master IP address is：$net_address"
+MI_select_eth_echo_5="Master MAC address is：$net_MacAddr"
+
+#
+MI_show_master_info_echo_1="Master IP address is："
+MI_show_master_info_echo_2="Master MAC address is： "
+
+
+#
+MI_make_ssh_key_echo_1="Producing SSH Key... "
+MI_make_ssh_key_echo_2="SSH Key has been produced."
+
+#
+MI_set_haoop_site_echo_1="Setting hadoop-site.xml... "
+MI_set_haoop_site_echo_2="Setting hadoop-site.xml finished."
+
+#
+MI_set_nutch_site_echo_1="Setting nutch-site.xml..."
+MI_set_nutch_site_echo_2="Setting http.agent.url at line: $Line_NO..."
+MI_set_nutch_site_echo_3="Editing http.agent.url, delete line $Line_NO."
+MI_set_nutch_site_echo_4="Editing http.agent.url finished."
+MI_set_nutch_site_echo_5="Setting http.agent.email at line：$Line_NO."
+MI_set_nutch_site_echo_6="Editing http.agent.email, delete line $Line_NO."
+MI_set_nutch_site_echo_7="Editing http.agent.email finished."
+MI_set_nutch_site_echo_8="Editing hadoop-site.xmlfinished."
+
+#
+MI_format_HDFS_echo_1="Formatting HDFS..."
+MI_format_HDFS_echo_2="HDFS has been formatted."
+
+#
+MI_start_up_NutchEZ_echo_1="Start up NutchEZ..."
+
+#
+MI_set_hosts_echo_1="Set hosts on master"
+
+#
+MI_install_Nutch_echo_1="Master's IP address is："
+MI_install_Nutch_echo_2="Master's Hostname is："
+
+#
+MI_client_PassMasterIPAddr_echo_1="Edit MasterIP in client install file at line $Line_NO"
+MI_client_PassMasterIPAddr_echo_2="Editing MasterIP..."
+MI_client_PassMasterIPAddr_echo_3="MasterIP has been set."
+
+#
+MI_client_PassMaster_Hostname_echo_1="Edit master hostname in client install file at line $Line_NO"
+MI_client_PassMaster_Hostname_echo_2="Editing Hostname..."
+MI_client_PassMaster_Hostname_echo_3="Hostname has been set."
+
+#
+MI_make_client_install_echo_1="In function of make_client_install ..."
+
+#
+MI_start_up_tomcat_echo_1="Start up tomcat..."
+MI_start_up_tomcat_echo_2="Please wait about 10 sec..."
+MI_start_up_tomcat_echo_3="Tomcat has been started！"
+
+#
+MI_client_install_commands_echo_1="For client install, please refer commands as follows："
+MI_client_install_commands_echo_2="cd ~"
+MI_client_install_commands_echo_3="mkdir nutchez_client_install"
+MI_client_install_commands_echo_4="cd nutchez_client_install"
+MI_client_install_commands_echo_5="scp -r nutchuser@$MasterIP_Address:/home/nutchuser/nutchez/source/* ."
+MI_client_install_commands_echo_6="sudo su"
+MI_client_install_commands_echo_7="./client_install"
+
+########## Lang for Master Install - End##########
+
+########## Lang for Client Install - Start##########
+
+# [Variables Declaration] #
+## Lang for client_install ##
+par_echo_1="Your master IP is:"
+par_echo_2="Is this information cooect? (yes/no): "
+par_echo_3="These parameters are correct."
+par_echo_4="Please edit these parameters in this file."
+
+## [Lang for client_install_fun.sh] ##
+### [for choose_lang()] ###
+choose_lang_1="Please choose your language: (1)English (2)中文"
+choose_lang_2="(1/2):"
+
+### [for check_root()]###
+check_root_1="Please Change root to execute it!!!"
+check_root_2="Identify is root."
+
+### [for check_systemInfo()]###
+check_sys_1="check_systemInfo"
+check_sys_2="Your system information are: "
+
+### [for install_packages()]###
+install_pack_1="install_packages"
+install_pack_2="Check dependent packages"
+install_pack_if_1="It will install some packages (expect, ssh, and dialog)."
+install_pack_if_2="Please manually install expect, ssh, and dialog."
+
+### [for check_nez_installed()] ###
+check_nez_1="chcheck_nez_installed"
+check_nez_2="System already had NutchEz."
+check_nez_3="System does not has NutchEz."
+
+### [for check_sunJava()] ###
+check_sunJava_1="check_sunJava"
+check_sunJava_2="NutchEz need Sun Java JDK 1.6.x or above version"
+check_sunJava_if_1="Java is not Sun version, plz install sun Java 1.6.X"
+check_sunJava_if_2="Please input your choice: "
+check_sunJava_if_3="(1)System don't have Sun Java (2)Sun Java is in other path (3)Exit"
+check_sunJava_if_4="plz input (1/2/3): "
+check_sunJava_if_5="Please install Sun Java manually!"
+check_sunJava_if_6="Input Sun Java home path(ex. '/usr/lib/jvm/java-6-sun-1.6.0.12' or using default '/usr' ): "
+check_sunJava_if_7="It is not Sun Java! Plz install Sun Java manually !"
+check_sunJava_if_8="Java version is too old (it need 1.6.X above)"
+check_sunJava_if_9="System has Sun Java 1.6 above version."
+check_sunJava_if_10="Please install Sun JAVA 1.6.X or above version"
+
+### [for check_ssh()] ###
+check_ssh_1="check_ssh"
+check_ssh_2="System has ssh."
+check_ssh_3="Please install ssh."
+check_ssh_4="System has ssh Server (sshd)."
+check_ssh_5="Please install ssh Server (sshd)."
+
+### [for check_dialog()] ###
+check_dialog_1="check_dialog"
+check_dialog_2="System has dialog."
+check_dialog_3="Please install dialog."
+
+### scp_master_nutchuser_sshkey() ###
+scp_sshkey_d1="scp_master_nutchuser_sshkey"
+scp_sshkey_d2="mkdir -p /home/nutchuser/"
+scp_sshkey_d3="scp nutchuser@master:~/.ssh /home/nutchuser/"
+scp_sshkey_expect_1="Password is error"
+scp_sshkey_s1="scp correct."
+scp_sshkey_s2="scp error,\n(1)plese check nutchuser password in server\n(2)nutchuser's authorized_keys in server\n(3)server's network status"
+scp_sshkey_d4="chown -R nutchuser:nutchuser /home/nutchuser/.ssh"
+
+### [for creat_nutchuser_account()] ###
+create_nutchuser_d1="creat_nutchuser_account"
+create_nutchuser_1="Plz input nutchuser password of master node: "
+create_nutchuser_2="plz input nutchuser password, again: "
+create_nutchuser_3="Two Passwords match."
+create_nutchuser_4="Two passwords don't match, please re-input nutchuser's password."
+create_nutchuser_s1="System already has nutchuser, change nutchuser password."
+create_nutchuser_s2="Create nutchuser and change password."
+
+### [for scp_packages()] ###
+scp_packages_d1="scp_packages"
+scp_packages_d2="chown -R nutchuser:nutchuser /opt/nutchez"
+scp_packages_d3="scp -r nutchuser@\$1:/opt/nutchez/NutchezForClientOf_\$Master_IP_Address.tar.gz /home/nutchuser/nutchez/source"
+
+### [for install_nutch_package()] ###
+install_nutch_package_d1="install_nutch_package"
+
+### [for recall_hostname_ip()] ###
+recall_hostname_ip_d1="recall_hostname_ip"
+recall_hostname_ip_1="net_address is"
+recall_hostname_ip_2="net_MacAddr is"
+recall_hostname_ip_3="System have multiple network device, which network use for this machine: "
+recall_hostname_ip_4="Please choice(1/2/3...): "
+recall_hostname_ip_d2="ssh nutchuser@\$1 echo \$net_address \$(hostname) \$net_MacAddr \>\> ~/nutchez/system/nutch_nodes"
+
+########## Lang for Client Install - End##########
+
+########## Lang for Master Remove - Start##########
+
+# check root
+MR_check_root_1="Please change root to execute it!!!"
+MR_check_root_2="Identify is root, let's continue！"
+
+# shutdown service
+MR_shutdown_service_echo_1="Stop the service of slaves..."
+MR_shutdown_service_echo_2="Stop the service of master..."
+MR_shutdown_service_echo_3="The service of Master"
+
+# remove_folders
+MR_remove_folders_echo_1="Deleting floders and files of NutchEZ..."
+MR_remove_folders_echo_2="Floders and files has deleted."
+
+# edit_hosts
+MR_edit_hosts_echo_1="Restoring /etc/hosts..."
+MR_edit_hosts_echo_2="/etc/hosts restoring finished."
+
+# user_delete
+MR_user_delete_echo_1="Deleting user: nutchuser..."
+MR_user_delete_echo_2="nutchuser has deleted"
+
+# main
+MR_main_echo_1="Warning - this program will remove nutchEZ, if you don't understard what this program to do, please press Ctrl+c to leave！"
+MR_main_echo_2="This program will delete all of nutchEZ's files and folders and delete user nutchuser."
+MR_main_echo_3="Are you sure to remove this node? 1.Yes 2.No "
+MR_main_echo_4="NutchEZ had removed！"
+MR_main_echo_5="You are cancelling this remove procedure！"
+MR_main_echo_6="If you want to remove NutchEZ of this node, please execute this program again."
+
+########## Lang for Master Remove - End ##########
+
+########## Lang for Client Remove - Start ##########
+# check root
+CR_check_root_1="Please change root to execute it!!!"
+CR_check_root_2="Identify is root！"
+
+# shutdown service
+CR_shutdown_service_echo_1="Shutdown all service of this node..."
+CR_shutdown_service_echo_2="The service of this node had shutdown."
+
+# remove_folders
+CR_remove_folders_echo_1="Deleting floders and files of NutchEZ..."
+CR_remove_folders_echo_2="Floders and files has deleted."
+
+# edit_hosts
+CR_edit_hosts_echo_1="Restoring /etc/hosts..."
+CR_edit_hosts_echo_2="/etc/hosts restoring finished."
+
+# user_delete
+CR_user_delete_echo_1="Deleting user: nutchuser..."
+CR_user_delete_echo_2="nutchuser has deleted"
+
+# main
+CR_main_echo_1="Warning - this program will remove nutchEZ, if you don't understard what this program to do, please press Ctrl+c to leave！"
+CR_main_echo_2="This program will delete all of nutchEZ's files and folders and delete user nutchuser."
+CR_main_echo_3="Are you sure to remove this node? 1.Yes 2.No "
+CR_main_echo_4="NutchEZ had removed！"
+CR_main_echo_5="You are cancelling this remove procedure！"
+CR_main_echo_6="If you want to remove NutchEZ of this node, please execute this program again."
+########## Lang for Client Remove - End ##########
+
+########## Lang for nutchez - Start ##########
+# [Variables Declaration] #
+## Lang for common ##
+user_error="You aren't nutchuser，please change to  \"nutchuser\" !!!"
+
+## [Lang for dialog] ##
+dia_back='= [NutchEz Management Interface] ~by NCHC ='
+dia_choose="Please choose what you want to do: "
+dia_exit="Exit"
+
+## [Lang for prepare_check] ##
+dia_pre_check_title_1="[file nutch_nodes]"
+dia_pre_check_msg_1="Failure：System can't find it!"
+dia_pre_check_title_2="[Update /etc/host]"
+dia_pre_check_yesno_1="You are frist execute NutchEz Management Interface"
+dia_pre_check_yesno_2="Please update /etc/hosts !!!"
+pre_check_echo_1="Please enter root's password to update /etc/hosts !!!"
+pre_check_echo_2="root password error，please make sure root's password is correct!!!"
+dia_pre_check_yesno_3="nutch_nodes has modified"
+
+## [Lang for main_menu()] ##
+dia_main_title_1="[Management Options]"
+dia_main_menu_1_1="Check cluster state"
+dia_main_menu_1_2="Set datanode & tasktracker"
+dia_main_menu_1_3="Set namenode & jobtracker"
+dia_main_menu_1_4="Startup/Shutdown/Restart Tomcat"
+dia_main_menu_1_5="Change Tomcat port"
+dia_main_menu_1_6="Change language"
+
+## [Lang for cluster_status()] ##
+cluster_status_echo_1="[IP] \t\t [Hostname] \t [Network] \t [Dtatnode & Tasktracker]"
+cluster_status_echo_2="Start check cluster..."
+cluster_status_read_1="press any key to continue..."
+dia_cluster_status_title_1="[Cluster state]"
+
+## [Lang for srver_setup()] ##
+dia_server_title_1="[Server State]"
+dia_server_msg_1="Namenode & Jobtracker shutdown"
+dia_server_msg_2="Jobtracker running, Namenode shutdown"
+dia_server_msg_3="Namenode running, Jobtracker shutdown"
+dia_server_msg_4="Namenode & Jobtracker running"
+dia_server_title_2="[Set Namenode & Jobtracker]"
+dia_server_menu_1_1="Startup Namenode & Jobtracker"
+dia_server_menu_1_2="Shutdown Namenode & Jobtracker"
+dia_server_menu_1_3="Restart Namenode & Jobtracker"
+
+## [Labg for cluster_setup()] ##
+dia_cluster_setup_title_1="[All or part of nodes]"
+dia_cluster_setup_menu_1_1="All nodes"
+dia_cluster_setup_menu_1_2="A part of nodes"
+dia_cluster_setup_title_2="[Select Datanode & Tasktracker Nodes]"
+dia_cluster_setup_check_1="Select Datanode & Tasktracker: "
+dia_cluster_setup_title_3="[Set Datanode & Tasktracker]"
+dia_cluster_setup_menu_2_1="Startup Datanodes & Tasktrackers"
+dia_cluster_setup_menu_2_2="Shutdown Datanodes & Tasktrackers"
+dia_cluster_setup_menu_2_3="Restart Datanodes & Tasktrackers"
+cluster_setup_echo_1="[Startup datanode & tasktracker]"
+cluster_setup_echo_error="Failure：can't connect to ssh "
+cluster_setup_echo_3="[Shutdown datanode & tasktracker]"
+cluster_setup_echo_5="[Restart datanode & tasktracker]"
+
+## [Lang for tomcat_swith()] #
+dia_tomcat_switch_title_1="[Tomcat state]"
+dia_tomcat_switch_msg_1="Tomcat is running !!!"
+dia_tomcat_switch_msg_2="Tomcat doesn't run !!!"
+dia_tomcat_switch_title_2="[The service of Tomcat]"
+dia_tomcat_switch_menu_1_1="Startup Tomcat"
+dia_tomcat_switch_menu_1_2="Stop Tomcat"
+dia_tomcat_switch_menu_1_3="Restart Tomcat"
+tomcat_switch_echo_1="Failure：System can't find it!"
+tomcat_switch_echo_3="[Start up Tomcat]"
+tomcat_switch_echo_4="[Shutdown Tomcat]"
+tomcat_switch_echo_5="[Restart Tomcat]"
+
+## [Lang for tomcat_port()] ##
+dia_tomcat_port_title_1="[Edit Tomcat servel.xml]"
+dia_tomcat_port_msg_1="Edit failure: Can't find the file."
+dia_tomcat_port_title_2="[Change Tomcat Port ]"
+dia_tomcat_port_input_1="Please enter tomcat port NO.(default 8080): "
+
+## [Lang for lang_switch()] ##
+dia_lang_title_1="[Change language]"
+dia_lang_menu_1_1="English"
+dia_lang_menu_1_2="中文"
+########## Lang for nutchez - End ##########
Index: /nutchez-0.2/src/shell/lang/lang_en_US_client_install
===================================================================
--- /nutchez-0.2/src/shell/lang/lang_en_US_client_install	(revision 217)
+++ /nutchez-0.2/src/shell/lang/lang_en_US_client_install	(revision 217)
@@ -0,0 +1,101 @@
+#!/bin/bash
+# Program:
+#   English Language file for client_install
+# Author:
+#   Waue, Shunfa, Rock {waue, shunfa, rock}@nchc.org.tw
+# Version:
+#    1.0
+# History:
+#   2010/06/14  Rock    First release (1.0)
+
+# [Variables Declaration] #
+## Lang for client_install ##
+par_echo_1="Your master IP:"
+par_echo_2="Is this data cooect? (yes/no): "
+par_echo_3="These parameters are correct."
+par_echo_4="Please edit these parameters in this file."
+
+## [Lang for client_install_fun.sh] ##
+### [for choose_lang()] ###
+choose_lang_1="Plz choose your language: (1)English (2)中文"
+choose_lang_2="(1/2):"
+
+### [for check_root()]###
+check_root_1="Please Change root to execute it!!!"
+check_root_2="Identify is root."
+
+### [for check_systemInfo()]###
+check_sys_1="check_systemInfo"
+check_sys_2="Your system information are: "
+
+### [for install_packages()]###
+install_pack_1="install_packages"
+install_pack_2="Check dependent packages"
+install_pack_if_1="It will install some packages (expect, ssh, and dialog)."
+install_pack_if_2="Please manually install expect, ssh, and dialog."
+
+### [for check_nez_installed()] ###
+check_nez_1="chcheck_nez_installed"
+check_nez_2="System already had NutchEz."
+check_nez_3="System does not has NutchEz."
+
+### [for check_sunJava()] ###
+check_sunJava_1="check_sunJava"
+check_sunJava_2="NutchEz need Sun Java JDK 1.6.x or above version"
+check_sunJava_if_1="Java is not Sun version, plz install sun Java 1.6.X"
+check_sunJava_if_2="Please input your choice: "
+check_sunJava_if_3="(1)System don't have Sun Java (2)Sun Java is in other path (3)Exit"
+check_sunJava_if_4="plz input (1/2/3): "
+check_sunJava_if_5="Please install Sun Java manually!"
+check_sunJava_if_6="Input Sun Java home path(ex. '/usr/lib/jvm/java-6-sun-1.6.0.12' or using default '/usr' ): "
+check_sunJava_if_7="It is not Sun Java! Plz install Sun Java manually !"
+check_sunJava_if_8="Java version is too old (it need 1.6.X above)"
+check_sunJava_if_9="System has Sun Java 1.6 above version."
+check_sunJava_if_10="Please install Sun JAVA 1.6.X or above version"
+
+### [for check_ssh()] ###
+check_ssh_1="check_ssh"
+check_ssh_2="System has ssh."
+check_ssh_3="Please install ssh."
+check_ssh_4="System has ssh Server (sshd)."
+check_ssh_5="Please install ssh Server (sshd)."
+
+### [for check_dialog()] ###
+check_dialog_1="check_dialog"
+check_dialog_2="System has dialog."
+check_dialog_3="Please install dialog."
+
+### scp_master_nutchuser_sshkey() ###
+scp_sshkey_d1="scp_master_nutchuser_sshkey"
+scp_sshkey_d2="mkdir -p /home/nutchuser/"
+scp_sshkey_d3="scp nutchuser@master:~/.ssh /home/nutchuser/"
+scp_sshkey_expect_1="Password is error"
+scp_sshkey_s1="scp correct."
+scp_sshkey_s2="scp error,\n(1)plese check nutchuser password in server\n(2)nutchuser's authorized_keys in server\n(3)server's network status"
+scp_sshkey_d4="chown -R nutchuser:nutchuser /home/nutchuser/.ssh"
+
+### [for creat_nutchuser_account()] ###
+create_nutchuser_d1="creat_nutchuser_account"
+create_nutchuser_1="Plz input nutchuser password of master node: "
+create_nutchuser_2="plz input nutchuser password, again: "
+create_nutchuser_3="Two Passwords match."
+create_nutchuser_4="Two passwords don't match, please re-input nutchuser's password."
+create_nutchuser_s1="System already has nutchuser, change nutchuser password."
+create_nutchuser_s2="Create nutchuser and change password."
+
+### [for scp_packages()] ###
+scp_packages_d1="scp_packages"
+scp_packages_d2="chown -R nutchuser:nutchuser /opt/nutchez"
+scp_packages_d3="scp -r nutchuser@\$1:/opt/nutchez/NutchezForClientOf_\$Master_IP_Address.tar.gz /home/nutchuser/nutchez/source"
+
+### [for install_nutch_package()] ###
+install_nutch_package_d1="install_nutch_package"
+
+### [for recall_hostname_ip()] ###
+recall_hostname_ip_d1="recall_hostname_ip"
+recall_hostname_ip_1="net_address is"
+recall_hostname_ip_2="net_MacAddr is"
+recall_hostname_ip_3="System have multiple network device, which network use for this machine: "
+recall_hostname_ip_4="Please choice(1/2/3...): "
+recall_hostname_ip_d2="ssh nutchuser@\$1 echo \$net_address \$(hostname) \$net_MacAddr \>\> ~/nutchez/system/nutch_nodes"
+
Index: /nutchez-0.2/src/shell/lang/lang_en_US_nutchez
===================================================================
--- /nutchez-0.2/src/shell/lang/lang_en_US_nutchez	(revision 217)
+++ /nutchez-0.2/src/shell/lang/lang_en_US_nutchez	(revision 217)
@@ -0,0 +1,94 @@
+#!/bin/bash
+# Program:
+#   English Language file for nutchez
+# Author:
+#   Waue, Shunfa, Rock {waue, shunfa, rock}@nchc.org.tw
+# Version:
+#    1.0
+# History:
+#   2010/06/14  Rock    First release (1.0)
+
+# [Variables Declaration] #
+## Lang for common ##
+user_error="Your identify is not nutchuser, plz change to \"nutchuser\" !!!"
+
+## [Lang for dialog] ##
+dia_back='= [NutchEz Management Interface] ~by NCHC ='
+dia_choose="Plz choose: "
+dia_exit="Exit"
+
+## [Lang for prepare_check] ##
+dia_pre_check_title_1="[nutch_nodes Files]"
+dia_pre_check_msg_1="Fail: Don't find"
+dia_pre_check_title_2="[/etc/host Update]"
+dia_pre_check_yesno_1="First execut nutchez management interface."
+dia_pre_check_yesno_2="Plz update /etc/hosts !!!"
+pre_check_echo_1="Plz input root password to update /etc/hosts !!!"
+pre_check_echo_2="Root password is error ! Plz check root password !!!"
+dia_pre_check_yesno_3="nutch_nodes already be modified."
+
+## [Lang for main_menu()] ##
+dia_main_title_1="[Management Options]"
+dia_main_menu_1_1="Check cluster status"
+dia_main_menu_1_2="Setup datanode & tasktracker"
+dia_main_menu_1_3="Setup namenode & jobtracker"
+dia_main_menu_1_4="Start/Stop/Restart Tomcat"
+dia_main_menu_1_5="Change Tomcat port"
+dia_main_menu_1_6="Change language"
+
+## [Lang for cluster_status()] ##
+cluster_status_echo_1="[IP] \t\t [Hostname] \t [Network] \t [Dtatnode & Tasktracker]"
+cluster_status_echo_2="Start to check cluster.."
+cluster_status_read_1="Plz input anykey to continue.."
+dia_cluster_status_title_1="[Cluster Status]"
+
+## [Lang for srver_setup()] ##
+dia_server_title_1="[Server Status]"
+dia_server_msg_1="Namenode & Jobtracker are not running"
+dia_server_msg_2="Jobtracker is running, Namenode is not running"
+dia_server_msg_3="Namenode is running, Jobtracker is not running"
+dia_server_msg_4="Namenode & Jobtracker are running"
+dia_server_title_2="[Namenode & Jobtracker Setup]"
+dia_server_menu_1_1="Start Namenode & Jobtracker"
+dia_server_menu_1_2="Stop Namenode & Jobtracker"
+dia_server_menu_1_3="Restart Namenode & Jobtracker"
+
+## [Labg for cluster_setup()] ##
+dia_cluster_setup_title_1="[All or Part nodes]"
+dia_cluster_setup_menu_1_1="All nodes"
+dia_cluster_setup_menu_1_2="Part nodes"
+dia_cluster_setup_title_2="[Datanode & Tasktracker Nodes Choice]"
+dia_cluster_setup_check_1="Choose Datanode & Tasktracker: "
+dia_cluster_setup_title_3="[Datanode & Tasktracker Setup]"
+dia_cluster_setup_menu_2_1="Start Datanodes & Tasktrackers"
+dia_cluster_setup_menu_2_2="Stop Datanodes & Tasktrackers"
+dia_cluster_setup_menu_2_3="Restart Datanodes & Tasktrackers"
+cluster_setup_echo_1="[Start datanode & tasktracker]"
+cluster_setup_echo_error="Can't ssh to "
+cluster_setup_echo_3="[Stop datanode & tasktracker]"
+cluster_setup_echo_5="[Restart datanode & tasktracker]"
+
+## [Lang for tomcat_swith()] #
+dia_tomcat_switch_title_1="[Tomcat Status]"
+dia_tomcat_switch_msg_1="Tomcat is runing !!!"
+dia_tomcat_switch_msg_2="Tomcat is not running !!!"
+dia_tomcat_switch_title_2="[Tomcat Service Options]"
+dia_tomcat_switch_menu_1_1="Start Tomcat"
+dia_tomcat_switch_menu_1_2="Stop Tomcat"
+dia_tomcat_switch_menu_1_3="Restart Tomcat"
+tomcat_switch_echo_1="Faul: Don't fine"
+tomcat_switch_echo_3="[Start Tomcat]"
+tomcat_switch_echo_4="[Stop Tomcat]"
+tomcat_switch_echo_5="[Restart Tomcat]"
+
+## [Lang for tomcat_port()] ##
+dia_tomcat_port_title_1="[Check Tomcat servel.xml]"
+dia_tomcat_port_msg_1="Faill: Don't find"
+dia_tomcat_port_title_2="[Tomcat Port Change]"
+dia_tomcat_port_input_1="Plz input port number for tomcat (default is 8080)"
+
+## [Lang for lang_switch()] ##
+dia_lang_title_1="[Language Switch]"
+dia_lang_menu_1_1="English"
+dia_lang_menu_1_2="Chinese"
+
Index: /nutchez-0.2/src/shell/lang/lang_zh_TW
===================================================================
--- /nutchez-0.2/src/shell/lang/lang_zh_TW	(revision 217)
+++ /nutchez-0.2/src/shell/lang/lang_zh_TW	(revision 217)
@@ -0,0 +1,388 @@
+#!/bin/bash
+# Program:
+#   Chinese Language file for NutchEZ 
+# Author:
+#   Waue, Shunfa, Rock {waue, shunfa, rock}@nchc.org.tw
+# Version:
+#    1.0
+# History:
+#
+
+############ Lang for master_install -Start ############
+MI_main_echo_1="歡迎使用NutchEZ, 此安裝程序會為您新建一個nutchuser帳號並協助您設定>密碼"
+MI_main_echo_2="請確認上述的安裝資訊：1.正確 2.不正確 "
+MI_main_echo_3="安裝成功！"
+MI_main_echo_4="請進入管理頁面：http://$MasterIP_Address:8080"
+
+## Lang for master_install_func.sh ##
+### [for choose_lang()] ### 
+MI_choose_lang_1="請選擇語言: (1)English (2)中文" 
+MI_choose_lang_2="(1/2):" 
+
+### [for check_root()]### 
+MI_check_root_1="請切換成 root 身份執行!!!" 
+MI_check_root_2="身份是 root" 
+ 
+### [for check_systemInfo()]### 
+MI_check_sys_1="check_systemInfo" 
+MI_check_sys_2="作業系統為: " 
+ 
+### [for install_packages()]### 
+MI_install_pack_1="install_packages" 
+MI_install_pack_2="檢查套件相依性" 
+MI_install_pack_if_1="將會安裝 expect, ssh 和 dialog　套件" 
+MI_install_pack_if_2="請手動安裝 expect, ssh 和 dialog 套件" 
+ 
+### [for check_nez_installed()] ### 
+MI_check_nez_1="chcheck_nez_installed" 
+MI_check_nez_2="系統先前已安裝NutchEz" 
+MI_check_nez_3="系統尚未安裝 NutchEz" 
+ 
+### [for check_sunJava()] ### 
+MI_check_sunJava_1="check_sunJava" 
+MI_check_sunJava_2="NutchEz 需要 Sun Java JDK 1.6 以上的版本" 
+MI_check_sunJava_if_1="Java 並不是 Sun　版本, 請自行安裝 Sun 版本的 Java" 
+MI_check_sunJava_if_2="請輸入您的選擇: " 
+MI_check_sunJava_if_3="(1)系統沒有 Sun Java (2)Sun Java已安裝並於其他路徑 (3)結束" 
+MI_check_sunJava_if_4="請選擇 (1/2/3): " 
+MI_check_sunJava_if_5="請自行安裝 Sun Java 1.6 以上版本" 
+MI_check_sunJava_if_6="請輸入 Sum Java 的家路徑 (例如： '/usr/lib/jvm/java-6-sun-1.6.0.12'): " 
+MI_check_sunJava_if_7="Java 並不是 Sun　版本, 請自行安裝 Sun 版本的 Java" 
+MI_check_sunJava_if_8="Java 版本太舊 (請更新至 1.6　以上版本)" 
+MI_check_sunJava_if_9="系統有 Sun Java 1.6 以上版本" 
+MI_check_sunJava_if_10="請自行安裝 Sun Java 1.6 以上版本" 
+ 
+### [for check_ssh()] ### 
+MI_check_ssh_1="check_ssh" 
+MI_check_ssh_2="系統已有 ssh." 
+MI_check_ssh_3="請安裝 ssh." 
+MI_check_ssh_4="系統已有 ssh Server (sshd)." 
+MI_check_ssh_5="請安裝 ssh Server (sshd)." 
+ 
+### [for check_dialog()] ### 
+MI_check_dialog_1="check_dialog" 
+MI_check_dialog_2="系統已有 dialog." 
+MI_check_dialog_3="請安裝 dialog." 
+	 	 
+#
+MI_set_nutchuser_passwd_echo_1="請輸入欲設定的nutchuser密碼："
+MI_set_nutchuser_passwd_echo_2="請再輸入一次確認密碼："
+
+#
+MI_select_eth_echo_1="系統偵測到目前擁有網卡如下："
+MI_select_eth_echo_2="請選擇欲給nutchez使用的網卡(1/2/3)："
+MI_select_eth_echo_3="您選擇的網卡為：$net_choice"
+MI_select_eth_echo_4="Master網路IP位址為：$net_address"
+MI_select_eth_echo_5="Master的MAC為：$net_MacAddr"
+
+#
+MI_show_master_info_echo_1="Master網路IP位址為："
+MI_show_master_info_echo_2="Master的MAC為： "
+
+
+#
+MI_make_ssh_key_echo_1="正在產生SSH Key... "
+MI_make_ssh_key_echo_2="SSH Key已產生"
+
+#
+MI_set_haoop_site_echo_1="正在設定hadoop-site.xml... "
+MI_set_haoop_site_echo_2="hadoop-site.xml設定完成"
+
+#
+MI_set_nutch_site_echo_1="正在設定nutch-site.xml..."
+MI_set_nutch_site_echo_2="http.agent.url 設定行號為：$Line_NO..."
+MI_set_nutch_site_echo_3="編輯http.agent.url, 刪除行號 $Line_NO."
+MI_set_nutch_site_echo_4="編輯http.agent.url完成"
+MI_set_nutch_site_echo_5="http.agent.email 設定行號為：$Line_NO."
+MI_set_nutch_site_echo_6="編輯http.agent.email, 刪除行號 $Line_NO."
+MI_set_nutch_site_echo_7="編輯http.agent.email完成"
+MI_set_nutch_site_echo_8="hadoop-site.xml設定完成"
+
+#
+MI_format_HDFS_echo_1="格式化HDFS..."
+MI_format_HDFS_echo_2="格式化HDFS完成"
+
+#
+MI_start_up_NutchEZ_echo_1="啟動NutchEZ..."
+
+#
+MI_set_hosts_echo_1="設定master上的hosts"
+
+#
+MI_install_Nutch_echo_1="Master的IP位址為："
+MI_install_Nutch_echo_2="Master的Hostname為："
+
+#
+MI_client_PassMasterIPAddr_echo_1="在client安裝檔修改MasterIP的行號: $Line_NO"
+MI_client_PassMasterIPAddr_echo_2="編輯MasterIP..."
+MI_client_PassMasterIPAddr_echo_3="完成編輯MasterIP."
+
+#
+MI_client_PassMaster_Hostname_echo_1="在client安裝檔修改Hostname, 行號為: $Line_NO"
+MI_client_PassMaster_Hostname_echo_2="編輯Hostname..."
+MI_client_PassMaster_Hostname_echo_3="完成編輯Hostname."
+
+#
+MI_make_client_install_echo_1="於function make_client_install ..."
+
+#
+MI_start_up_tomcat_echo_1="啟動tomcat..."
+MI_start_up_tomcat_echo_2="等待約10秒..."
+MI_start_up_tomcat_echo_3="tomcat 已經啟動！"
+
+#
+MI_client_install_commands_echo_1="Client安裝可參考以下指令："
+MI_client_install_commands_echo_2="cd ~"
+MI_client_install_commands_echo_3="mkdir nutchez_client_install"
+MI_client_install_commands_echo_4="cd nutchez_client_install"
+MI_client_install_commands_echo_5="scp -r nutchuser@$MasterIP_Address:/home/nutchuser/nutchez/source/* ."
+MI_client_install_commands_echo_6="sudo su"
+MI_client_install_commands_echo_7="./client_install"
+
+########## Lang for Master Install - End##########
+
+########## Lang for Client Install - Start##########
+
+CI_finish_echo_1="NutchEZ 已完成安裝此一Client端"
+
+# [Variables Declaration] #
+## Lang for client_install ##
+par_echo_1="Master 的 IP位址: "
+par_echo_2="資料是否正確 (yes/no): "
+par_echo_3="資料是正錯的"
+par_echo_4="請修改為正確的參數"
+
+## [Lang for client_install_fun.sh] ##
+### [for choose_lang()] ###
+choose_lang_1="請選擇語言: (1)English (2)中文"
+choose_lang_2="(1/2):"
+
+### [for check_root()]###
+check_root_1="請切換成 root 身份執行!!!"
+check_root_2="身份是 root"
+
+### [for check_systemInfo()]###
+check_sys_1="check_systemInfo"
+check_sys_2="作業系統為: "
+
+### [for install_packages()]###
+install_pack_1="install_packages"
+install_pack_2="檢查套件相依性"
+install_pack_if_1="將會安裝 expect, ssh 和 dialog　套件"
+install_pack_if_2="請手動安裝 expect, ssh 和 dialog 套件"
+
+### [for check_nez_installed()] ###
+check_nez_1="chcheck_nez_installed"
+check_nez_2="系統先前已安裝NutchEz"
+check_nez_3="系統尚未安裝 NutchEz"
+
+### [for check_sunJava()] ###
+check_sunJava_1="check_sunJava"
+check_sunJava_2="NutchEz 需要 Sun Java JDK 1.6 以上的版本"
+check_sunJava_if_1="Java 並不是 Sun　版本, 請自行安裝 Sun 版本的 Java"
+check_sunJava_if_2="請輸入您的選擇: "
+check_sunJava_if_3="(1)系統沒有 Sun Java (2)Sun Java　在其他路徑 (3)結束"
+check_sunJava_if_4="請選擇 (1/2/3): "
+check_sunJava_if_5="請自行安裝 Sun Java 1.6 以上版本"
+check_sunJava_if_6="請輸入 Sum Java 的家路徑 (例如： '/usr/lib/jvm/java-6-sun-1.6.0.12'): "
+check_sunJava_if_7="Java 並不是 Sun　版本, 請自行安裝 Sun 版本的 Java"
+check_sunJava_if_8="Java 版本太舊 (請更新至 1.6　以上版本)"
+check_sunJava_if_9="系統有 Sun Java 1.6 以上版本"
+check_sunJava_if_10="請自行安裝 Sun Java 1.6 以上版本"
+
+### [for check_ssh()] ###
+check_ssh_1="check_ssh"
+check_ssh_2="系統已有 ssh."
+check_ssh_3="請安裝 ssh."
+check_ssh_4="系統已有 ssh Server (sshd)."
+check_ssh_5="請安裝 ssh Server (sshd)."
+
+### [for check_dialog()] ###
+check_dialog_1="check_dialog"
+check_dialog_2="系統已有 dialog."
+check_dialog_3="請安裝 dialog."
+
+### scp_master_nutchuser_sshkey() ###
+scp_sshkey_d1="scp_master_nutchuser_sshkey"
+scp_sshkey_d2="mkdir -p /home/nutchuser/"
+scp_sshkey_d3="scp nutchuser@master:~/.ssh /home/nutchuser/"
+scp_sshkey_expect_1="密碼錯誤"
+scp_sshkey_s1="scp 正確"
+scp_sshkey_s2="scp 失敗,\n(1)請確認 Master 的 nutchuser 的密碼\n(2)Master 上 nutchuser's 的 sshkey\n(3)Master 的網路狀態"
+scp_sshkey_d4="chown -R nutchuser:nutchuser /home/nutchuser/.ssh"
+
+### [for creat_nutchuser_account()] ###
+create_nutchuser_d1="creat_nutchuser_account"
+create_nutchuser_1="請輸入 Master 上 nuchuser 使用者的密碼: "
+create_nutchuser_2="請再輸入一次: "
+create_nutchuser_3="兩次密碼一致"
+create_nutchuser_4="兩次密碼不一致，請重新輸入"
+create_nutchuser_s1="系統已經有 nutchuser，直接更改 nuchuser 密碼"
+create_nutchuser_s2="建立 nuchuser 使用者並更改密碼"
+
+### [for scp_packages()] ###
+scp_packages_d1="scp_packages"
+scp_packages_d2="chown -R nutchuser:nutchuser /opt/nutchez"
+scp_packages_d3="scp -r nutchuser@\$1:/opt/nutchez/NutchezForClientOf_\$Master_IP_Address.tar.gz /home/nutchuser/nutchez/source"
+
+### [for install_nutch_package()] ###
+install_nutch_package_d1="install_nutch_package"
+
+### [for recall_hostname_ip()] ###
+recall_hostname_ip_d1="recall_hostname_ip"
+recall_hostname_ip_1="網路IP位址是"
+recall_hostname_ip_2="網卡MAC位址是"
+recall_hostname_ip_3="系統有多張網卡，請選擇那張網卡是適用於此環境: "
+recall_hostname_ip_4="請選擇 (1/2/3...): "
+recall_hostname_ip_d2="ssh nutchuser@\$1 echo \$net_address \$(hostname) \$net_MacAddr \>\> ~/nutchez/system/nutch_nodes"
+
+########## Lang for Client Install - End##########
+
+########## Lang for Master Remove - Start##########
+
+# check root
+MR_check_root_1="請切換成 root 身份執行移除程式!!!"
+MR_check_root_2="已確認為root身份, 將繼續執行此移除程式！"
+
+# shutdown service
+MR_shutdown_service_echo_1="停止其他尚未關閉的slaves服務..."
+MR_shutdown_service_echo_2="關閉本機服務..."
+MR_shutdown_service_echo_3="本機服務已關閉"
+
+# remove_folders
+MR_remove_folders_echo_1="正在刪除安裝時所建立的檔案及資料夾..."
+MR_remove_folders_echo_2="安裝時所建立的檔案及資料夾已刪除"
+
+# edit_hosts
+MR_edit_hosts_echo_1="還原/etc/hosts...至安裝NutchEZ前的版本"
+MR_edit_hosts_echo_2="完成修改/etc/hosts"
+
+# user_delete
+MR_user_delete_echo_1="正在刪除nutchuser使用者..."
+MR_user_delete_echo_2="使用者nutchuser已刪除"
+
+# main
+MR_main_echo_1="警告 - 此一程式為移除nutchEZ程式, 若您為誤執行此一程式, 請按Ctrl+c離開此程序！"
+MR_main_echo_2="本執行程序將會移除安裝nutchEZ時所新增的檔案及nutchuser使用者帳號。"
+MR_main_echo_3="請問是否確定移除此一節點：1.確定 2.取消 "
+MR_main_echo_4="移除程序已完成！"
+MR_main_echo_5="您已取消移除程序！"
+MR_main_echo_6="若要移除請再重新執行！"
+
+########## Lang for Master Remove - End ##########
+
+########## Lang for Client Remove - Start ##########
+# check root
+CR_check_root_1="請切換成 root 身份執行移除程式!!!"
+CR_check_root_2="已確認為root身份, 將繼續執行此移除程式！"
+
+# shutdown service
+CR_shutdown_service_echo_1="關閉本機服務..."
+CR_shutdown_service_echo_2="本機服務已關閉"
+
+# remove_folders
+CR_remove_folders_echo_1="正在刪除安裝時所建立的檔案及資料夾..."
+CR_remove_folders_echo_2="安裝時所建立的檔案及資料夾已刪除"
+
+# edit_hosts
+CR_edit_hosts_echo_1="還原/etc/hosts...至安裝NutchEZ前的版本"
+CR_edit_hosts_echo_2="完成修改/etc/hosts"
+
+# user_delete
+CR_user_delete_echo_1="正在刪除nutchuser使用者..."
+CR_user_delete_echo_2="使用者nutchuser已刪除"
+
+# main
+CR_main_echo_1="警告 - 此一程式為移除此用戶端的nutch node, 若您為誤執行此一程式, 請按Ctrl+c離開此程序！"
+CR_main_echo_2="本執行程序將會移除安裝nutchEZ時所新增的檔案及nutchuser使用者帳號。"
+CR_main_echo_3="請問是否確定移除此一節點：1.確定 2.取消 "
+CR_main_echo_4="移除程序已完成！"
+CR_main_echo_5="您已取消移除程序！"
+CR_main_echo_6="若要移除請再重新執行！"
+########## Lang for Client Remove - End ##########
+
+########## Lang for nutchez - Start ##########
+# [Variables Declaration] #
+## Lang for common ##
+user_error="您不是nutchuser，請切換成 \"nutchuser\" 使用者 !!!"
+
+## [Lang for dialog] ##
+dia_back='= [NutchEz 管理介面] ~by NCHC ='
+dia_choose="請選擇: "
+dia_exit="結束"
+
+## [Lang for prepare_check] ##
+dia_pre_check_title_1="[nutch_nodes 檔案]"
+dia_pre_check_msg_1="失敗：找不到"
+dia_pre_check_title_2="[/etc/host 檔案更新]"
+dia_pre_check_yesno_1="第一次執行 nutchez 管理介面"
+dia_pre_check_yesno_2="請更新 /etc/hosts !!!"
+pre_check_echo_1="請輸入 root 密碼來更新 /etc/hosts !!!"
+pre_check_echo_2="root 密碼錯誤，請先確認 root 密碼是否正確 !!!"
+dia_pre_check_yesno_3="nutch_nodes 檔案已被修改過"
+
+## [Lang for main_menu()] ##
+dia_main_title_1="[管理功能選項]"
+dia_main_menu_1_1="檢查 Cluster 狀態"
+dia_main_menu_1_2="設定 datanode & tasktracker"
+dia_main_menu_1_3="設定 namenode & jobtracker"
+dia_main_menu_1_4="啟動/停止/重新啟動 Tomcat"
+dia_main_menu_1_5="更改 Tomcat port"
+dia_main_menu_1_6="更換語言"
+
+## [Lang for cluster_status()] ##
+cluster_status_echo_1="[IP] \t\t [Hostname] \t [Network] \t [Dtatnode & Tasktracker]"
+cluster_status_echo_2="開始檢查 Cluster..."
+cluster_status_read_1="請輸入任何鍵繼續..."
+dia_cluster_status_title_1="[Cluster 狀態]"
+
+## [Lang for srver_setup()] ##
+dia_server_title_1="[Server 狀態]"
+dia_server_msg_1="Namenode & Jobtracker 並未運作"
+dia_server_msg_2="Jobtracker 正在運作, Namenode 並未運作"
+dia_server_msg_3="Namenode 正在運作, Jobtracker 並未運作"
+dia_server_msg_4="Namenode & Jobtracker 正在運作"
+dia_server_title_2="[Namenode & Jobtracker 設定]"
+dia_server_menu_1_1="啟動 Namenode & Jobtracker"
+dia_server_menu_1_2="停止 Namenode & Jobtracker"
+dia_server_menu_1_3="重新啟動 Namenode & Jobtracker"
+
+## [Labg for cluster_setup()] ##
+dia_cluster_setup_title_1="[全部或部份 nodes]"
+dia_cluster_setup_menu_1_1="全部 nodes"
+dia_cluster_setup_menu_1_2="部份 nodes"
+dia_cluster_setup_title_2="[Datanode & Tasktracker Nodes 選擇]"
+dia_cluster_setup_check_1="選擇 Datanode & Tasktracker: "
+dia_cluster_setup_title_3="[Datanode & Tasktracker 設定]"
+dia_cluster_setup_menu_2_1="啟動 Datanodes & Tasktrackers"
+dia_cluster_setup_menu_2_2="停止 Datanodes & Tasktrackers"
+dia_cluster_setup_menu_2_3="重新啟動 Datanodes & Tasktrackers"
+cluster_setup_echo_1="[啟動 datanode & tasktracker]"
+cluster_setup_echo_error="失敗：無法 ssh 到 "
+cluster_setup_echo_3="[停止 datanode & tasktracker]"
+cluster_setup_echo_5="[重新啟動 datanode & tasktracker]"
+
+## [Lang for tomcat_swith()] #
+dia_tomcat_switch_title_1="[Tomcat 狀態]"
+dia_tomcat_switch_msg_1="Tomcat 正在執行 !!!"
+dia_tomcat_switch_msg_2="Tomcat 並未執行 !!!"
+dia_tomcat_switch_title_2="[Tomcat 服務選項]"
+dia_tomcat_switch_menu_1_1="啟動 Tomcat"
+dia_tomcat_switch_menu_1_2="停止 Tomcat"
+dia_tomcat_switch_menu_1_3="重新啟動 Tomcat"
+tomcat_switch_echo_1="失敗：找不到"
+tomcat_switch_echo_3="[啟動 Tomcat]"
+tomcat_switch_echo_4="[停止 Tomcat]"
+tomcat_switch_echo_5="[重新啟動 Tomcat]"
+
+## [Lang for tomcat_port()] ##
+dia_tomcat_port_title_1="[更改 Tomcat servel.xml]"
+dia_tomcat_port_msg_1="失敗: 找不到"
+dia_tomcat_port_title_2="[Tomcat Port 更改]"
+dia_tomcat_port_input_1="請輸入要更改的 Tomcat port 號碼 (預設值為 8080): "
+
+## [Lang for lang_switch()] ##
+dia_lang_title_1="[轉換語言]"
+dia_lang_menu_1_1="英文"
+dia_lang_menu_1_2="中文"
+########## Lang for nutchez - End ##########
Index: /nutchez-0.2/src/shell/lang/lang_zh_TW_client_install
===================================================================
--- /nutchez-0.2/src/shell/lang/lang_zh_TW_client_install	(revision 217)
+++ /nutchez-0.2/src/shell/lang/lang_zh_TW_client_install	(revision 217)
@@ -0,0 +1,101 @@
+#!/bin/bash
+# Program:
+#   Chinese Language file for client_install
+# Author:
+#   Waue, Shunfa, Rock {waue, shunfa, rock}@nchc.org.tw
+# Version:
+#    1.0
+# History:
+#   2010/06/15  Rock    First release (1.0)
+
+# [Variables Declaration] #
+## Lang for client_install ##
+par_echo_1="Master 的 IP位址: "
+par_echo_2="資料是否正確 (yes/no): "
+par_echo_3="資料是正錯的"
+par_echo_4="請修改為正確的參數"
+
+## [Lang for client_install_fun.sh] ##
+### [for choose_lang()] ###
+choose_lang_1="請選擇語言: (1)English (2)中文"
+choose_lang_2="(1/2):"
+
+### [for check_root()]###
+check_root_1="請切換成 root 身份執行!!!"
+check_root_2="身份是 root"
+
+### [for check_systemInfo()]###
+check_sys_1="check_systemInfo"
+check_sys_2="作業系統為: "
+
+### [for install_packages()]###
+install_pack_1="install_packages"
+install_pack_2="檢查套件相依性"
+install_pack_if_1="將會安裝 expect, ssh 和 dialog　套件"
+install_pack_if_2="請手動安裝 expect, ssh 和 dialog 套件"
+
+### [for check_nez_installed()] ###
+check_nez_1="chcheck_nez_installed"
+check_nez_2="系統先前已安裝NutchEz"
+check_nez_3="系統尚未安裝 NutchEz"
+
+### [for check_sunJava()] ###
+check_sunJava_1="check_sunJava"
+check_sunJava_2="NutchEz 需要 Sun Java JDK 1.6 以上的版本"
+check_sunJava_if_1="Java 並不是 Sun　版本, 請自行安裝 Sun 版本的 Java"
+check_sunJava_if_2="請輸入您的選擇: "
+check_sunJava_if_3="(1)系統沒有 Sun Java (2)Sun Java　在其他路徑 (3)結束"
+check_sunJava_if_4="請選擇 (1/2/3): "
+check_sunJava_if_5="請自行安裝 Sun Java 1.6 以上版本"
+check_sunJava_if_6="請輸入 Sum Java 的家路徑 (例如： '/usr/lib/jvm/java-6-sun-1.6.0.12'): "
+check_sunJava_if_7="Java 並不是 Sun　版本, 請自行安裝 Sun 版本的 Java"
+check_sunJava_if_8="Java 版本太舊 (請更新至 1.6　以上版本)"
+check_sunJava_if_9="系統有 Sun Java 1.6 以上版本"
+check_sunJava_if_10="請自行安裝 Sun Java 1.6 以上版本"
+
+### [for check_ssh()] ###
+check_ssh_1="check_ssh"
+check_ssh_2="系統已有 ssh."
+check_ssh_3="請安裝 ssh."
+check_ssh_4="系統已有 ssh Server (sshd)."
+check_ssh_5="請安裝 ssh Server (sshd)."
+
+### [for check_dialog()] ###
+check_dialog_1="check_dialog"
+check_dialog_2="系統已有 dialog."
+check_dialog_3="請安裝 dialog."
+
+### scp_master_nutchuser_sshkey() ###
+scp_sshkey_d1="scp_master_nutchuser_sshkey"
+scp_sshkey_d2="mkdir -p /home/nutchuser/"
+scp_sshkey_d3="scp nutchuser@master:~/.ssh /home/nutchuser/"
+scp_sshkey_expect_1="密碼錯誤"
+scp_sshkey_s1="scp 正確"
+scp_sshkey_s2="scp 失敗,\n(1)請確認 Master 的 nutchuser 的密碼\n(2)Master 上 nutchuser's 的 sshkey\n(3)Master 的網路狀態"
+scp_sshkey_d4="chown -R nutchuser:nutchuser /home/nutchuser/.ssh"
+
+### [for creat_nutchuser_account()] ###
+create_nutchuser_d1="creat_nutchuser_account"
+create_nutchuser_1="請輸入 Master 上 nuchuser 使用者的密碼: "
+create_nutchuser_2="請再輸入一次: "
+create_nutchuser_3="兩次密碼一致"
+create_nutchuser_4="兩次密碼不一致，請重新輸入"
+create_nutchuser_s1="系統已經有 nutchuser，直接更改 nuchuser 密碼"
+create_nutchuser_s2="建立 nuchuser 使用者並更改密碼"
+
+### [for scp_packages()] ###
+scp_packages_d1="scp_packages"
+scp_packages_d2="chown -R nutchuser:nutchuser /opt/nutchez"
+scp_packages_d3="scp -r nutchuser@\$1:/opt/nutchez/NutchezForClientOf_\$Master_IP_Address.tar.gz /home/nutchuser/nutchez/source"
+
+### [for install_nutch_package()] ###
+install_nutch_package_d1="install_nutch_package"
+
+### [for recall_hostname_ip()] ###
+recall_hostname_ip_d1="recall_hostname_ip"
+recall_hostname_ip_1="網路IP位址是"
+recall_hostname_ip_2="網卡MAC位址是"
+recall_hostname_ip_3="系統有多張網卡，請選擇那張網卡是適用於此環境: "
+recall_hostname_ip_4="請選擇 (1/2/3...): "
+recall_hostname_ip_d2="ssh nutchuser@\$1 echo \$net_address \$(hostname) \$net_MacAddr \>\> ~/nutchez/system/nutch_nodes"
+
Index: /nutchez-0.2/src/shell/lang/lang_zh_TW_client_remove
===================================================================
--- /nutchez-0.2/src/shell/lang/lang_zh_TW_client_remove	(revision 217)
+++ /nutchez-0.2/src/shell/lang/lang_zh_TW_client_remove	(revision 217)
@@ -0,0 +1,38 @@
+#!/bin/bash
+# Program:
+#   Chinese Language file for client_remove
+# Author:
+#   Waue, Shunfa, Rock {waue, shunfa, rock}@nchc.org.tw
+# Version:
+#    1.0
+# History:
+#  
+
+# check root
+check_root_1="請切換成 root 身份執行移除程式!!!"
+check_root_2="已確認為root身份, 將繼續執行此移除程式！"
+
+# shutdown service
+shutdown_service_echo_1="關閉本機服務..."
+shutdown_service_echo_2="本機服務已關閉"
+
+# remove_folders
+remove_folders_echo_1="正在刪除安裝時所建立的檔案及資料夾..."
+remove_folders_echo_2="安裝時所建立的檔案及資料夾已刪除"
+
+# edit_hosts
+edit_hosts_echo_1="修改/etc/hosts..."
+edit_hosts_echo_2="完成修改/etc/hosts"
+
+# user_delete
+user_delete_echo_1="正在刪除nutchuser使用者..."
+user_delete_echo_2="使用者nutchuser已刪除"
+
+# main
+main_echo_1="警告 - 此一程式為移除此用戶端的nutch node, 若您為誤執行此一程式, 請按Ctrl+c離開此程序！"
+main_echo_2="本執行程序將會移除安裝nutchEZ時所新增的檔案及nutchuser使用者帳號。"
+main_echo_3="請問是否確定移除此一節點：1.確定 2.取消"
+main_echo_4="移除程序已完成！"
+main_echo_5="您已取消移除程序！"
+main_echo_6="若要移除請再重新執行！"
+
Index: /nutchez-0.2/src/shell/lang/lang_zh_TW_master_remove
===================================================================
--- /nutchez-0.2/src/shell/lang/lang_zh_TW_master_remove	(revision 217)
+++ /nutchez-0.2/src/shell/lang/lang_zh_TW_master_remove	(revision 217)
@@ -0,0 +1,39 @@
+#!/bin/bash
+# Program:
+#   Chinese Language file for client_remove
+# Author:
+#   Waue, Shunfa, Rock {waue, shunfa, rock}@nchc.org.tw
+# Version:
+#    1.0
+# History:
+#  
+
+# check root
+check_root_1="請切換成 root 身份執行移除程式!!!"
+check_root_2="已確認為root身份, 將繼續執行此移除程式！"
+
+# shutdown service
+shutdown_service_echo_1="停止其他尚未關閉的slaves服務..."
+shutdown_service_echo_2="關閉本機服務..."
+shutdown_service_echo_3="本機服務已關閉"
+
+# remove_folders
+remove_folders_echo_1="正在刪除安裝時所建立的檔案及資料夾..."
+remove_folders_echo_2="安裝時所建立的檔案及資料夾已刪除"
+
+# edit_hosts
+edit_hosts_echo_1="修改/etc/hosts..."
+edit_hosts_echo_2="完成修改/etc/hosts"
+
+# user_delete
+user_delete_echo_1="正在刪除nutchuser使用者..."
+user_delete_echo_2="使用者nutchuser已刪除"
+
+# main
+main_echo_1="警告 - 此一程式為移除nutchEZ程式, 若您為誤執行此一程式, 請按Ctrl+c離開此程序！"
+main_echo_2="本執行程序將會移除安裝nutchEZ時所新增的檔案及nutchuser使用者帳號。"
+main_echo_3="請問是否確定移除此一節點：1.確定 2.取消"
+main_echo_4="移除程序已完成！"
+main_echo_5="您已取消移除程序！"
+main_echo_6="若要移除請再重新執行！"
+
Index: /nutchez-0.2/src/shell/lang/lang_zh_TW_nutchez
===================================================================
--- /nutchez-0.2/src/shell/lang/lang_zh_TW_nutchez	(revision 217)
+++ /nutchez-0.2/src/shell/lang/lang_zh_TW_nutchez	(revision 217)
@@ -0,0 +1,94 @@
+#!/bin/bash
+# Program:
+#   Chinese Language file for nutchez
+# Author:
+#   Waue, Shunfa, Rock {waue, shunfa, rock}@nchc.org.tw
+# Version:
+#    1.0
+# History:
+#   2010/06/14  Rock    First release (1.0)
+
+# [Variables Declaration] #
+## Lang for common ##
+user_error="您不是nutchuser，請切換成 \"nutchuser\" 使用者 !!!"
+
+## [Lang for dialog] ##
+dia_back='= [NutchEz 管理介面] ~by NCHC ='
+dia_choose="請選擇: "
+dia_exit="結束"
+
+## [Lang for prepare_check] ##
+dia_pre_check_title_1="[nutch_nodes 檔案]"
+dia_pre_check_msg_1="失敗：找不到"
+dia_pre_check_title_2="[/etc/host 檔案更新]"
+dia_pre_check_yesno_1="第一次執行 nutchez 管理介面"
+dia_pre_check_yesno_2="請更新 /etc/hosts !!!"
+pre_check_echo_1="請輸入 root 密碼來更新 /etc/hosts !!!"
+pre_check_echo_2="root 密碼錯誤，請先確認 root 密碼是否正確 !!!"
+dia_pre_check_yesno_3="nutch_nodes 檔案已被修改過"
+
+## [Lang for main_menu()] ##
+dia_main_title_1="[管理功能選項]"
+dia_main_menu_1_1="檢查 Cluster 狀態"
+dia_main_menu_1_2="設定 datanode & tasktracker"
+dia_main_menu_1_3="設定 namenode & jobtracker"
+dia_main_menu_1_4="啟動/停止/重新啟動 Tomcat"
+dia_main_menu_1_5="更改 Tomcat port"
+dia_main_menu_1_6="更換語言"
+
+## [Lang for cluster_status()] ##
+cluster_status_echo_1="[IP] \t\t [Hostname] \t [Network] \t [Dtatnode & Tasktracker]"
+cluster_status_echo_2="開始檢查 Cluster..."
+cluster_status_read_1="請輸入任何鍵繼續..."
+dia_cluster_status_title_1="[Cluster 狀態]"
+
+## [Lang for srver_setup()] ##
+dia_server_title_1="[Server 狀態]"
+dia_server_msg_1="Namenode & Jobtracker 並未運作"
+dia_server_msg_2="Jobtracker 正在運作, Namenode 並未運作"
+dia_server_msg_3="Namenode 正在運作, Jobtracker 並未運作"
+dia_server_msg_4="Namenode & Jobtracker 正在運作"
+dia_server_title_2="[Namenode & Jobtracker 設定]"
+dia_server_menu_1_1="啟動 Namenode & Jobtracker"
+dia_server_menu_1_2="停止 Namenode & Jobtracker"
+dia_server_menu_1_3="重新啟動 Namenode & Jobtracker"
+
+## [Labg for cluster_setup()] ##
+dia_cluster_setup_title_1="[全部或部份 nodes]"
+dia_cluster_setup_menu_1_1="全部 nodes"
+dia_cluster_setup_menu_1_2="部份 nodes"
+dia_cluster_setup_title_2="[Datanode & Tasktracker Nodes 選擇]"
+dia_cluster_setup_check_1="選擇 Datanode & Tasktracker: "
+dia_cluster_setup_title_3="[Datanode & Tasktracker 設定]"
+dia_cluster_setup_menu_2_1="啟動 Datanodes & Tasktrackers"
+dia_cluster_setup_menu_2_2="停止 Datanodes & Tasktrackers"
+dia_cluster_setup_menu_2_3="重新啟動 Datanodes & Tasktrackers"
+cluster_setup_echo_1="[啟動 datanode & tasktracker]"
+cluster_setup_echo_error="失敗：無法 ssh 到 "
+cluster_setup_echo_3="[停止 datanode & tasktracker]"
+cluster_setup_echo_5="[重新啟動 datanode & tasktracker]"
+
+## [Lang for tomcat_swith()] #
+dia_tomcat_switch_title_1="[Tomcat 狀態]"
+dia_tomcat_switch_msg_1="Tomcat 正在執行 !!!"
+dia_tomcat_switch_msg_2="Tomcat 並未執行 !!!"
+dia_tomcat_switch_title_2="[Tomcat 服務選項]"
+dia_tomcat_switch_menu_1_1="啟動 Tomcat"
+dia_tomcat_switch_menu_1_2="停止 Tomcat"
+dia_tomcat_switch_menu_1_3="重新啟動 Tomcat"
+tomcat_switch_echo_1="失敗：找不到"
+tomcat_switch_echo_3="[啟動 Tomcat]"
+tomcat_switch_echo_4="[停止 Tomcat]"
+tomcat_switch_echo_5="[重新啟動 Tomcat]"
+
+## [Lang for tomcat_port()] ##
+dia_tomcat_port_title_1="[更改 Tomcat servel.xml]"
+dia_tomcat_port_msg_1="失敗: 找不到"
+dia_tomcat_port_title_2="[Tomcat Port 更改]"
+dia_tomcat_port_input_1="請輸入要更改的 Tomcat port 號碼 (預設值為 8080): "
+
+## [Lang for lang_switch()] ##
+dia_lang_title_1="[轉換語言]"
+dia_lang_menu_1_1="英文"
+dia_lang_menu_1_2="中文"
+
Index: /nutchez-0.2/src/shell/lang_link
===================================================================
--- /nutchez-0.2/src/shell/lang_link	(revision 217)
+++ /nutchez-0.2/src/shell/lang_link	(revision 217)
@@ -0,0 +1,1 @@
+link lang/lang_zh_TW
Index: /nutchez-0.2/src/shell/language_choise.sh
===================================================================
--- /nutchez-0.2/src/shell/language_choise.sh	(revision 217)
+++ /nutchez-0.2/src/shell/language_choise.sh	(revision 217)
@@ -0,0 +1,27 @@
+#!/bin/bash
+function choiseLanguage ( )
+{
+while [ 1 ]; do
+echo "中文，請輸入\"zh\"";
+echo "Please type \"en\" for English";
+read read_str;
+case "$read_str" in
+  en)
+        ln -sf ./install_lang.en ./install_lang
+	echo "You choise English! 死洋鬼子A"
+        break;
+        ;;
+  zh)
+#        ln -sf ./install_lang.zh ./install_lang
+        ln -sf lang/lang_zh_TW lang_link
+	echo "你選擇了中文"
+        break;
+        ;;
+  *)
+        echo "中文，請輸入\"zh\"";
+        echo "Please type \"en\" for English";
+esac
+done
+}
+
+choiseLanguage
Index: /nutchez-0.2/src/shell/master_remove.sh
===================================================================
--- /nutchez-0.2/src/shell/master_remove.sh	(revision 217)
+++ /nutchez-0.2/src/shell/master_remove.sh	(revision 217)
@@ -0,0 +1,108 @@
+#!/bin/bash
+# Program:
+#   remove shell script for master uninstall
+# Author:
+#   Waue, Shunfa, Rock {waue, shunfa, rock}@nchc.org.tw
+# Version:
+#    1.0
+# History:
+#   
+
+source ./lang_link
+
+##########  echo function  ##########
+function debug_info () {
+  if [ $? -eq 0 ]; then
+    echo -e "\033[1;35;40m info - $1 \033[0m"
+  fi
+}
+
+
+function show_info () {
+  if [ $? -eq 0 ]; then
+    echo -e "\033[1;32;40m $1 \033[0m"
+  fi
+}
+##########end echo function ##########
+
+nutch_PATH=/home/nutchuser/nutchez/system
+
+
+# check root
+function check_root(){
+  debug_info "check_root"
+  if [ $USER != "root" ]; then
+    show_info "$MR_check_root_1" # "請切換成 root 身份執行移除程式!!!"
+    exit
+  fi
+  show_info "$MR_check_root_2" # "已確認為root身份, 將繼續執行此移除程式！"
+}
+
+# shutdown service
+function shutdown_service () {
+  show_info "$MR_shutdown_service_echo_1" # "停止其他尚未關閉的slaves服務..."
+  slaves_list=`cat $nutch_PATH'/nutch_nodes' | cut -d' ' -f1`
+  for nutch_node in $slaves_list
+  do
+    su nutchuser -c "ssh nutchuser@$nutch_node /opt/nutchez/nutch/bin/hadoop-daemon.sh stop datanode"
+    su nutchuser -c "ssh nutchuser@$nutch_node /opt/nutchez/nutch/bin/hadoop-daemon.sh stop tasktracker"
+  done
+  show_info "$MR_shutdown_service_echo_2" # "關閉本機服務..."
+  su nutchuser -c "/opt/nutchez/nutch/bin/stop-all.sh"
+  su nutchuser -c "/opt/nutchez/tomcat/bin/shutdown.sh"
+  show_info "$MR_shutdown_service_echo_3" # "本機服務已關閉"
+}
+
+# 移除檔案及資料夾
+function remove_folders () {
+  show_info "$MR_remove_folders_echo_1" # "正在刪除安裝時所建立的檔案及資料夾..."
+  rm -rf /opt/nutchez
+  rm -rf /var/nutchez
+  show_info "$MR_remove_folders_echo_2" # "安裝時所建立的檔案及資料夾已刪除"
+}
+
+
+# 還原/etc/hosts
+function edit_hosts () {
+  show_info "$MR_edit_hosts_echo_1" # "修改/etc/hosts..."
+#  slaves_list=`cat $nutch_PATH'/nutch_nodes' | cut -d' ' -f1`
+#  for nutch_node in $slaves_list
+#  do
+#    Line_NO=`cat /etc/hosts | grep -n $nutch_node | sed 's/:.*//g'`
+#    if [[ $Line_NO -ge 1 ]]; then
+#      sed -i ''$Line_NO'd' /etc/hosts
+#    fi
+#  done
+  cat > /etc/hosts < /home/nutchuser/nutchez/system/hosts.bak
+  show_info "$MR_edit_hosts_echo_2" # "完成修改/etc/hosts"
+}
+
+# 移除使用者
+function user_delete () {
+  show_info "$MR_user_delete_echo_1" # "正在刪除nutchuser使用者..."
+  userdel -r nutchuser
+  show_info "$MR_user_delete_echo_2" # "使用者nutchuser已刪除"
+}
+
+# Main function
+function main () {
+  show_info "$MR_main_echo_1" #"警告 - 此一程式為移除nutchEZ程式, 若您為誤執行此一程式, 請按Ctrl+c離開此程序！"
+  show_info "$MR_main_echo_2" #"本執行程序將會移除安裝nutchEZ時所新增的檔案及nutchuser使用者帳號"
+# 詢問是否繼續
+  read -p "$MR_main_echo_3" confirm # "請問是否確定移除此一節點：1.確定 2.取消"
+# 確認移除
+  if [ $confirm -eq 1 ]; then
+    check_root
+    shutdown_service
+    remove_folders
+    edit_hosts
+    user_delete
+    show_info "$MR_main_echo_4" # "移除程序已完成！"
+  elif [ $confirm -eq 2 ]; then
+    show_info "$MR_main_echo_5" # "您已取消移除程序！"
+    show_info "$MR_main_echo_6" # "若要移除請再重新執行！"
+  fi
+}
+
+main
+
Index: /nutchez-0.2/src/shell/nutchez
===================================================================
--- /nutchez-0.2/src/shell/nutchez	(revision 217)
+++ /nutchez-0.2/src/shell/nutchez	(revision 217)
@@ -0,0 +1,401 @@
+#!/bin/bash
+# Program:
+#   NutchEz management interface
+# Author: 
+#   Waue, Shunfa, Rock {waue, shunfa, rock}@nchc.org.tw
+# Version:
+#    1.0
+# History:
+#   2010/06/07  Rock    First release (1.0)
+
+# [Variables Declaration] #
+DIALOG="dialog"
+main_choice=
+lang=
+
+# [PATH Declaration] #
+NutchEZ_Install_PATH="/opt/nutchez"
+Tomcat_HOME="/opt/nutchez/tomcat"
+NutchEZ_HOME="/home/nutchuser/nutchez"
+Work_Path="./"
+Work_Path_J=0
+
+# Work Path setup
+echo $0 | grep '/' || Work_Path_J=1
+if [ "$Work_Path_J" == "0"  ]; then
+	Work_Path=$(echo $0 | sed 's/nutchez//')
+fi
+
+# [Env Declaration] #
+. $Work_Path/lang/lang_en_US_nutchez
+
+# [Functions Declaration] #
+## [Pre-check for language] ##
+function prepare_lang(){
+lang=$(locale | grep 'LANG=' | cut -d "=" -f2)
+
+# if lang=zh then source lang_zh_TW_nutchez
+echo $lang | grep 'zh' && source $Work_Path/lang/lang_zh_TW_nutchez
+}
+
+
+## [Pre-Check for nutch_nodes file] ##
+function prepare_check(){ 
+# 若無 nutchez_nodes　則跳出
+if [ ! -e "${NutchEZ_HOME}/system/nutch_nodes" ]; then
+    $DIALOG --clear --backtitle "$dia_back" --title "$dia_pre_check_title_1" \
+    --msgbox "$dia_pre_check_msg_1 $NutchEZ_HOME/system/nutch_nodes !!!" 10 40
+    exit
+fi
+
+# 判斷 nutch_nodes　和 nutch_nodes.back
+# 第一次執行則要求 user　更新 /etc/hosts
+if [ ! -e "${NutchEZ_HOME}/system/nutch_nodes.bak" ]; then
+    $DIALOG --clear --backtitle "$dia_back" --title "$dia_pre_check_title_2" \
+    --yesno "$dia_pre_check_yesno_1\n$dia_pre_check_yesno_2" 10 55
+
+    echo -e "$pre_check_echo_1"
+    ./duplicate_del "${NutchEZ_HOME}/system/nutch_nodes"
+    su root -c "./duplicate_del /etc/hosts && ./add_hosts ${NutchEZ_HOME}/system/nutch_nodes /etc/hosts"
+    #　若密碼輸入失敗則跳出
+    if [ $? == "1" ]; then
+        echo "$pre_check_echo_2"
+        exit
+    fi 
+# 若 nutch_nodes 被更新過，則要求更新 /etc/hosts
+elif [ ${NutchEZ_HOME}/system/nutch_nodes -nt ${NutchEZ_HOME}/system/nutch_nodes.bak ]; then
+    $DIALOG --clear --backtitle "$dia_back" --title "$dia_pre_check_title_2" \
+    --yesno "$dia_pre_check_yesno_3\n$dia_pre_check_yesno_2" 10 55
+
+    echo -e "$pre_check_echo_1"
+    ./duplicate_del "${NutchEZ_HOME}/system/nutch_nodes"
+    su root -c "./duplicate_del /etc/hosts && ./add_hosts ${NutchEZ_HOME}/system/nutch_nodes /etc/hosts"
+    #　若密碼輸入失敗則跳出                   
+    if [ $? == "1" ]; then                    
+        echo "$pre_check_echo_2="
+        exit                                  
+    fi
+fi
+}
+
+## [Main Menu] ##
+function main_menu(){
+main_choice="/tmp/main_choice"
+
+$DIALOG --clear --backtitle "$dia_back" \
+    --title "$dia_main_title_1" \
+        --menu "$dia_choose" 15 60 7 \
+        "cluster_status" "$dia_main_menu_1_1" \
+        "cluster_setup" "$dia_main_menu_1_2" \
+        "server_setup" "$dia_main_menu_1_3" \
+        "tomcat_switch" "$dia_main_menu_1_4" \
+        "tomcat_port" "$dia_main_menu_1_5" \
+        "lang_switch" "$dia_main_menu_1_6" \
+        "exit" "$dia_exit" 2>$main_choice
+}
+
+## [Cluster Status (datanode & tasktracker)] ##
+function cluster_status(){
+IP_list=$(cat $NutchEZ_HOME/system/nutch_nodes | grep -v '^$' | grep -v '#'  | awk '{print $1}')
+clusterStatus="/tmp/clusterStatus"
+rm $clusterStatus 2> /dev/null
+#printf '%16s\t %11s\t %10s\t %25s\n' "[IP] [Hostanme] [Network] [Dtatnode & Tasktracker]" >>$clusterStatus
+echo -e "$cluster_status_echo_1" >>$clusterStatus
+echo -e "------------------------------------------------------------------------" >>$clusterStatus
+echo -e "\n$cluster_status_echo_2"
+for ip in $IP_list
+do
+    # Check Network status
+    ip_status="online"
+    ping -c1 -w1 $ip 2>&1 > /dev/null || ip_status="offline"
+    # Check Hadoop/Nutch service through ssh
+    Task_Data_status="stop"
+    if [ $ip_status == "online" ]; then
+    Task_Data=$(ssh -o StrictHostKeyChecking=no $ip "jps |grep TaskTracker ; jps | grep  DataNode")
+    fi
+
+    [ -z "$Task_Data" ] || Task_Data_status="running"
+    host_name=$(cat $NutchEZ_HOME/system/nutch_nodes | grep $ip | awk '{print $2}')
+    echo -e "$ip  $host_name \t\t $ip_status \t $Task_Data_status" >>$clusterStatus
+#    printf '%16s\t %11s\t %10s\t %25s\n' "$ip $host_name $ip_status $Task_Data_status" >>$clusterStatus
+done
+
+read -p "$cluster_status_read_1"
+$DIALOG --clear --backtitle "$dia_back" \
+     --title "$dia_cluster_status_title_1" --textbox $clusterStatus 20 90
+
+    # Back to main menu 
+    main_menu
+    menu_choose
+}
+
+
+## [Server Setup (namenode & jobtracker)] ##
+function server_setup(){
+serverSetup=/tmp/serverSetup
+pid_name=$(jps | grep NameNode)
+pid_job=$(jps | grep JobTracker)
+
+if [ -z "$pid_name" -a -z "$pid_job" ]; then                                                                                               
+    $DIALOG --clear --backtitle "$dia_back" --title "$dia_server_title_1" \
+    --msgbox "$dia_server_msg_1" 7 50
+elif [ -z "$pid_name" -a -n "$pid_job" ]; then
+    $DIALOG --clear --backtitle "$dia_back" --title "$dia_server_title_1" \
+    --msgbox "$dia_server_msg_2" 7 50
+elif [ -n "$pid_name" -a -z "$pid_job" ]; then
+    $DIALOG --clear --backtitle "$dia_back" --title "$dia_server_title_1" \
+    --msgbox "$dia_server_msg_3" 7 50
+else
+    $DIALOG --clear --backtitle "$dia_back" --title "$dia_server_title_1" \
+    --msgbox "$dia_server_msg_4" 7 50
+fi
+
+$DIALOG --clear --backtitle "$dia_back" --title "$dia_server_title_2" \
+    --menu "$dia_choose" 15 65 4 \
+    "start" "$dia_server_menu_1_1" \
+    "stop" "$dia_server_menu_1_2" \
+    "restart" "$dia_server_menu_1_3" \
+    "exit" "$dia_exit" 2>$serverSetup
+
+if [ "$(cat $serverSetup)" == "start" ]; then
+    $NutchEZ_Install_PATH/nutch/bin/start-dfs.sh
+    $NutchEZ_Install_PATH/nutch/bin/start-mapred.sh
+elif [ "$(cat $serverSetup)" == "stop" ]; then
+    $NutchEZ_Install_PATH/nutch/bin/stop-dfs.sh
+    $NutchEZ_Install_PATH/nutch/bin/stop-mapred.sh
+elif [ "$(cat $serverSetup)" == "restart" ]; then
+    $NutchEZ_Install_PATH/nutch/bin/stop-dfs.sh
+    $NutchEZ_Install_PATH/nutch/bin/stop-mapred.sh
+    $NutchEZ_Install_PATH/nutch/bin/start-dfs.sh
+    $NutchEZ_Install_PATH/nutch/bin/start-mapred.sh
+else
+    exit
+fi
+
+    # Back to main menu                                                                                    
+    main_menu       
+    menu_choose
+}
+
+
+## [Cluster Setup (datanode & tasktracker)] ##
+function cluster_setup(){
+# 從 nutch_nodes 讀出 ip　和 hostname
+#IP_list=$(cat $NutchEZ_HOME/system/nutch_nodes | grep -v '^$' | grep -v '#' | awk '{print $1}')
+#HOST_list=$(cat $NutchEZ_HOME/system/nutch_nodes | grep -v '^$' | grep -v '#' | awk '{print $2}')
+LIST_status="off"
+allpart="/tmp/allpart"
+runNodes="/tmp/runNodes"
+clusterSetup="/tmp/clusterSetup"
+
+$DIALOG --clear --backtitle "$dia_back" \
+    --title "$dia_cluster_setup_title_1" \
+    --menu "$dia_choose" 15 55 3 \
+    "All" "$dia_cluster_setup_menu_1_1" \
+    "Part" "$dia_cluster_setup_menu_1_2" \
+    "Exit" "$dia_exit" 2>$allpart
+
+# 判斷是否選 all　和 part，若是 all　直接到服務選單，若是 part 則先到機器選單
+if [ "$(cat $allpart)" == "All" ]; then
+     cat $NutchEZ_HOME/system/nutch_nodes | grep -v '^$' | grep -v '#'  | awk '{print $1}' >$runNodes
+elif [ "$(cat $allpart)" == "Part" ]; then
+    $DIALOG --clear --backtitle "$dia_back" --title "$dia_cluster_setup_title_2" \
+    --checklist "$dia_cluster_setup_check_1" 15 55 7 $(cat $NutchEZ_HOME/system/nutch_nodes | \
+    grep -v '^$' | grep -v '#'  | awk '{print $1 "\t" $2 "\t" "$LIST_status" }') 2>$runNodes
+else
+    exit
+fi
+
+if [ -z "$(cat $runNodes)" ]; then
+    exit
+else
+    $(cat $runNodes) | sed -i 's/"//g' $runNodes 
+fi
+
+$DIALOG --clear --backtitle "$dia_back" --title "$dia_cluster_setup_title_3" \
+    --menu "$dia_choose" 15 65 4 \
+    "start" "$dia_cluster_setup_menu_2_1" \
+    "stop" "$dia_cluster_setup_menu_2_2" \
+    "restart" "$dia_cluster_setup_menu_2_3" \
+    "exit" "$dia_exit" 2>$clusterSetup
+
+if [ "$(cat $clusterSetup)" == "start" ]; then
+    echo -e "\n$cluster_setup_echo_1"
+    for node in $(cat $runNodes) 
+    do
+        ssh -o StrictHostKeyChecking=no $node "$NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh start datanode \
+        ; $NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh start tasktracker" 2>/dev/null
+        [ $? == "0" ] || echo "$cluster_setup_echo_error $node !!!"
+    done
+elif [ "$(cat $clusterSetup)" == "stop" ]; then
+    echo -e "\n$cluster_setup_echo_3"
+    for node in $(cat $runNodes)
+    do
+        ssh -o StrictHostKeyChecking=no $node "$NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh stop datanode \
+        ; $NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh stop tasktracker" 2>/dev/null
+        [ $? == "0" ] || echo "$cluster_setup_echo_error $node !!!"
+    done
+elif [ "$(cat $clusterSetup)" == "restart"  ]; then
+    echo -e "\n$cluster_setup_echo_5"
+    for node in $(cat $runNodes)
+    do  
+        ssh -o StrictHostKeyChecking=no $node "$NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh stop datanode \
+        ; $NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh stop tasktracker \
+        ; $NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh start datanode \
+        ; $NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh start tasktracker" 2>/dev/null
+        [ $? == "0" ] || echo "$cluster_setup_echo_error $node !!!"
+    done
+else
+    exit
+fi
+
+    # Back to main menu                                                                                    
+    main_menu       
+    menu_choose
+}
+
+## [Tomcat Severice start/stop/restart] ##
+function tomcat_switch(){
+tom_pids=$(ps x | grep -v 'grep' | grep "tomcat" | awk '{print $1}')
+if [ -n "$tom_pids" ]; then
+    $DIALOG --clear --backtitle "$dia_back" --title "$dia_tomcat_switch_title_1" \
+        --msgbox "$dia_tomcat_switch_msg_1" 7 50
+else
+    $DIALOG --clear --backtitle "$dia_back" --title "$dia_tomcat_switch_title_1" \
+        --msgbox "$dia_tomcat_switch_msg_2" 7 50
+fi
+tomcatSwitch="/tmp/tomcatSwitch"
+$DIALOG --clear --backtitle "$dia_back" --title "$dia_tomcat_switch_title_2" \
+    --menu "$dia_choose" 15 55 4 \
+        "start" "$dia_tomcat_switch_menu_1_1" \
+        "stop" "$dia_tomcat_switch_menu_1_2" \
+        "restart" "$dia_tomcat_switch_menu_1_3" \
+        "exit" "$dia_exit" 2>$tomcatSwitch
+
+if [ "$(cat $tomcatSwitch)" == "exit" ]; then
+    exit 0
+fi
+
+# jude $Tomcat_HOME/bin/startup.sh 
+if [ ! -e $Tomcat_HOME/bin/startup.sh ]; then
+    echo -e "\n$tomcat_switch_echo_1 $Tomcat_HOME/bin/startup.sh"
+    exit
+fi
+
+if [ ! -e $Tomcat_HOME/bin/shutdown.sh ]; then
+    echo -e "\n$tomcat_switch_echo_1 $Tomcat_HOME/bin/shutdown.sh"
+    exit
+fi
+
+if [ "$(cat $tomcatSwitch)" == "start" ]; then
+    echo "$tomcat_switch_echo_3"
+    $Tomcat_HOME/bin/startup.sh
+elif [ "$(cat $tomcatSwitch)" == "stop" ]; then
+    echo "$tomcat_switch_echo_4"
+    $Tomcat_HOME/bin/shutdown.sh
+    for tom_pid in $tom_pids
+    do
+        kill -9 $tom_pid 2>/dev/null
+    done
+elif [ "$(cat $tomcatSwitch)" == "restart" ]; then
+    echo "$tomcat_switch_echo_5"
+    $Tomcat_HOME/bin/shutdown.sh
+    for tom_pid in $tom_pids
+    do
+        kill -9 $tom_pid 2>/dev/null
+    done
+    $Tomcat_HOME/bin/startup.sh
+else
+    exit 0
+fi
+
+    # Back to main menu                                                                                    
+    main_menu       
+    menu_choose
+}
+
+## [Tomcat Port Change] ##
+function tomcat_port(){
+
+if [ ! -e $Tomcat_HOME/conf/server.xml ]; then
+    $DIALOG --clear --backtitle "$dia_back" --title "$dia_tomcat_port_title_1" \
+        --msgbox "$dia_tomcat_port_msg_1 $Tomcat_HOME/conf/server.xml !!!" 10 50
+    exit
+fi
+tomcatPort="/tmp/tomcatPort"
+$DIALOG --clear --backtitle "$dia_back" --title "$dia_tomcat_port_title_2" \
+    --inputbox "$dia_tomcat_port_input_1" 10 55 2>$tomcatPort
+
+if [ -z "$(cat $tomcatPort)" ]; then
+         # Back to main menu                                                                                
+         main_menu
+         menu_choose
+else
+    modify_line_nu=$(cat -n $Tomcat_HOME/conf/server.xml | grep -v SSL | grep 'HTTP/1.1' | grep '<Connector' | awk '{print $1}')
+    sed -i "${modify_line_nu}c <Connector port=\"$(cat $tomcatPort)\" protocol=\"HTTP/1.1\"" $Tomcat_HOME/conf/server.xml
+
+    tom_pids=$(ps x | grep -v 'grep' | grep "tomcat" | awk '{print $1}')
+    $Tomcat_HOME/bin/shutdown.sh
+    for tom_pid in $tom_pids
+       do
+           kill -9 $tom_pid 2>/dev/null
+       done
+    $Tomcat_HOME/bin/startup.sh
+fi
+
+    # Back to main menu                                                                                    
+    main_menu       
+    menu_choose
+}
+
+
+## [Language Change] ##
+function lang_switch(){
+langSwitch="/tmp/langSwitch"
+$DIALOG --clear --backtitle "$dia_back" --title "$dia_lang_title_1" \
+    --menu "$dia_choose" 15 55 3 \
+    "en_US" "$dia_lang_menu_1_1" \
+    "zh_TW" "$dia_lang_menu_1_2" \
+    "Exit" "$dia_exit" 2>$langSwitch
+#
+if [ "$(cat $langSwitch)" == "Exit" ]; then
+    exit
+elif [ "$(cat $langSwitch)" == "en_US" ]; then
+    source $Work_Path/lang/lang_en_US_nutchez
+    main_menu
+    menu_choose
+elif [ "$(cat $langSwitch)" == "zh_TW" ]; then
+    source $Work_Path/lang/lang_zh_TW_nutchez
+    main_menu
+    menu_choose
+fi
+}
+
+## [Menu_choose] ##
+function menu_choose(){
+case $(cat $main_choice) in
+    "cluster_status")
+        cluster_status;;
+    "cluster_setup")
+        cluster_setup;;
+    "server_setup")    
+        server_setup;;
+    "tomcat_switch")
+        tomcat_switch;;
+    "tomcat_port")
+        tomcat_port;;
+    "lang_switch")
+        lang_switch;;
+esac
+}
+
+# [Main Code] #
+if [ $USER != "nutchuser" ]; then
+    echo -e "\n$user_error"
+    exit
+fi
+
+prepare_lang
+prepare_check
+main_menu
+menu_choose
