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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.