Changeset 132


Ignore:
Timestamp:
May 28, 2010, 10:08:30 AM (14 years ago)
Author:
rock
Message:

修改部份功能,測試正常(於 Ubuntu 10.04 的桌機上測試)

Location:
nutchez-0.2/src/test
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • nutchez-0.2/src/test/client_install

    r130 r132  
    1212. ./client_install_func.sh
    1313
    14 # 需要master_install 設定的參數區
     14# 需要 master_install 設定的參數區
    1515Master_IP_Address="a.a.a.a";
    1616
     
    2121
    2222# 參數詢問
    23 yesno="no"   
     23yesno="no"
    2424echo -e "\nYour master IP: $Master_IP_Address"
    2525echo -e "Your Nutchuser Password: $Nutchuser_Passwd"
    2626read -p "These data are cooect? (yes/no): " yesno
    2727             
    28 if [ "$yesno" == "no" ];then
    29     echo "Plz edit these parameters of this file."
    30     exit     
    31     else     
    32 #    echo "yes"                                                                                   
     28if [ "$yesno" == "yes" ] || [ "$yesno" == "y" ] ; then
     29    echo "These parameters are correct."
     30else
     31    echo "Plz edit these parameters in this file."
     32    exit
    3333fi
    3434
     
    4444# 查出此主機的作業系統,以及版本
    4545check_systemInfo
     46read
     47
     48# 安裝需要的套件 (目前只支援 deb 套件的系統自動安裝,yum或其他套件系統的則必須手動安裝)
     49# 需要套件名稱 ssh, expect, dialog
     50install_packages
    4651read
    4752
  • nutchez-0.2/src/test/client_install_func.sh

    r129 r132  
    2727echo -e "\n= check_systemInfo (debug) ="
    2828echo -e "\nYour system information are:"
    29 lsb_release -a 2>/dev/null
     29distribution=$(lsb_release -d 2>/dev/null)
     30Linux_Distribution=$(echo $distribution | awk '{print $2}')
     31Linux_Version=$(echo $distribution | awk '{print $3}')
     32echo $Linux_Distribution , $Linux_Version
     33unset distribution
     34}
     35
     36
     37# 安裝需要的相依套件 (目前只支援 deb 套件的系統自動安裝,yum或其他套件系統的則需手動安裝)
     38function install_packages(){
     39# deb 系列系統
     40if [ "$Linux_Distribution" == "Ubuntu" ] || [ "$Linux_Distribution" == "Debian" ] ;then
     41    aptitude install -y expect ssh dialog
     42# rpm 系列系統
     43elif [ "$Linux_Distribution" == "Fedora" ] || [ "$Linux_Distribution" == "CentOS" ] ;then
     44    echo -e "Plz install expect, ssh, and dialog."
     45fi
    3046}
    3147
     
    3551function check_nez_installed(){
    3652echo -e "\n= chcheck_nez_installed (debug) ="
    37 test -d /opt/nutchez && echo -e "\nYour system already had NutchEz." || \
    38 echo -e "\nYour system does not has NutchEz."
     53if [ -d /opt/nutchez ]; then
     54    echo -e "\nSystem already had NutchEz."
     55    exit
     56else
     57    echo -e "\nSystem does not has NutchEz."
     58fi
    3959}
    4060
     
    177197    expect eof"
    178198else
    179     echo "System already has nutchuser, create nutchuser and change password."
     199    echo "Create nutchuser and change password."
    180200    useradd -m nutchuser -s /bin/bash
    181201    expect -c "spawn passwd nutchuser                 
Note: See TracChangeset for help on using the changeset viewer.