Changeset 132
- Timestamp:
- May 28, 2010, 10:08:30 AM (15 years ago)
- Location:
- nutchez-0.2/src/test
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
nutchez-0.2/src/test/client_install
r130 r132 12 12 . ./client_install_func.sh 13 13 14 # 需要 master_install 設定的參數區14 # 需要 master_install 設定的參數區 15 15 Master_IP_Address="a.a.a.a"; 16 16 … … 21 21 22 22 # 參數詢問 23 yesno="no" 23 yesno="no" 24 24 echo -e "\nYour master IP: $Master_IP_Address" 25 25 echo -e "Your Nutchuser Password: $Nutchuser_Passwd" 26 26 read -p "These data are cooect? (yes/no): " yesno 27 27 28 if [ "$yesno" == " no" ];then29 echo " Plz edit these parameters of this file."30 exit 31 e lse32 # echo "yes" 28 if [ "$yesno" == "yes" ] || [ "$yesno" == "y" ] ; then 29 echo "These parameters are correct." 30 else 31 echo "Plz edit these parameters in this file." 32 exit 33 33 fi 34 34 … … 44 44 # 查出此主機的作業系統,以及版本 45 45 check_systemInfo 46 read 47 48 # 安裝需要的套件 (目前只支援 deb 套件的系統自動安裝,yum或其他套件系統的則必須手動安裝) 49 # 需要套件名稱 ssh, expect, dialog 50 install_packages 46 51 read 47 52 -
nutchez-0.2/src/test/client_install_func.sh
r129 r132 27 27 echo -e "\n= check_systemInfo (debug) =" 28 28 echo -e "\nYour system information are:" 29 lsb_release -a 2>/dev/null 29 distribution=$(lsb_release -d 2>/dev/null) 30 Linux_Distribution=$(echo $distribution | awk '{print $2}') 31 Linux_Version=$(echo $distribution | awk '{print $3}') 32 echo $Linux_Distribution , $Linux_Version 33 unset distribution 34 } 35 36 37 # 安裝需要的相依套件 (目前只支援 deb 套件的系統自動安裝,yum或其他套件系統的則需手動安裝) 38 function install_packages(){ 39 # deb 系列系統 40 if [ "$Linux_Distribution" == "Ubuntu" ] || [ "$Linux_Distribution" == "Debian" ] ;then 41 aptitude install -y expect ssh dialog 42 # rpm 系列系統 43 elif [ "$Linux_Distribution" == "Fedora" ] || [ "$Linux_Distribution" == "CentOS" ] ;then 44 echo -e "Plz install expect, ssh, and dialog." 45 fi 30 46 } 31 47 … … 35 51 function check_nez_installed(){ 36 52 echo -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." 53 if [ -d /opt/nutchez ]; then 54 echo -e "\nSystem already had NutchEz." 55 exit 56 else 57 echo -e "\nSystem does not has NutchEz." 58 fi 39 59 } 40 60 … … 177 197 expect eof" 178 198 else 179 echo " System already has nutchuser, create nutchuser and change password."199 echo "Create nutchuser and change password." 180 200 useradd -m nutchuser -s /bin/bash 181 201 expect -c "spawn passwd nutchuser
Note: See TracChangeset
for help on using the changeset viewer.