Changeset 134


Ignore:
Timestamp:
May 28, 2010, 4:05:38 PM (14 years ago)
Author:
rock
Message:

修改討論後部份功能

Location:
nutchez-0.2/src/test
Files:
2 edited

Legend:

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

    r132 r134  
    1313
    1414# 需要 master_install 設定的參數區
    15 Master_IP_Address="a.a.a.a";
     15Master_IP_Address="140.110.138.193";
    1616
    1717# 此檔自己用的參數區
    1818Linux_Distribution="";
    1919Linux_Version="";
    20 Nutchuser_Passwd="xxxxxxxx";
     20Nutchuser_Passwd="nutchez";
    2121
    2222# 參數詢問
     
    5757
    5858# 檢查是否有安裝sun java ,並檢查是否為jdk 1.6 以上版本
    59 check_sunJava
     59#check_sunJava
    6060read
    6161
  • nutchez-0.2/src/test/client_install_func.sh

    r133 r134  
    148148echo -e "mkdir -p /home/nutchuser/"
    149149mkdir -p /home/nutchuser/
     150rm -fr /home/nutchuser/.ssh
    150151
    151152while [ ! -d "/home/nutchuser/.ssh" ]
     153do
     154    while [ "$Nutchuser_Passwd" != "$Nutchuser_Passwd2" ]
    152155    do
    153     echo -e "\n"
    154     read -p "Plz input nutchuser passwd of master node: " Nutchuser_Passwd
     156        echo -e "\n"
     157        read -p "Plz input nutchuser password of master node: " Nutchuser_Passwd
     158        read -p "plz input nutchuser password, again: " Nutchuser_Passwd2
     159            if [ "$1" == "$Nutchuser_Passwd2" ]; then
     160                echo "Two Passwords match."
     161            else
     162                echo "two passwords do not match, plz re-input nutchuser's password."
     163            fi
     164    done
     165   
     166    unset Nutchuser_Passwd2
     167
    155168    echo -e "scp nutchuser@$1:~/.ssh /home/nutchuser/"
    156169    expect -c "spawn scp -r -o StrictHostKeyChecking=no nutchuser@$1:~/.ssh /home/nutchuser/
    157170    expect \"*: \" { send \"$Nutchuser_Passwd\r\" }
    158     expect \"*: \" { send_user \"Passwd is error\" }
     171    expect \"*: \" { send_user \"Password is error\" }
    159172    expect eof"
    160173        if [ ! -d "/home/nutchuser/.ssh" ]; then
    161             echo -e "\nPasswd is error, plz re-input nutchuser passwd of master node."
     174            echo -e "\nPassword is error, plz re-input nutchuser passwd of master node."
    162175        else
    163176            echo -e "\nscp correct."
     
    172185function creat_nutchuser_account(){
    173186echo -e "\n= creat_nutchuser_account (debug) ="                             
    174 
    175 # 若沒 nutchuser_Passwd 的參數傳遞才將註解打開讓使用者字型輸入
    176 #while [ "1" != "$Nutchuser_Passwd2" ]
    177 #do
    178 #    read -p "Create nutchuser, plz input nutchuser's password: " Nutchuser_Passwd
    179 #    read -p "plz input nutchuser's password, again: " Nutchuser_Passwd2
    180 
    181 #    if [ "$1" == "$Nutchuser_Passwd2" ]; then
    182 #        echo "Two Passwords match."
    183 #    else
    184 #        echo "two passwords do not match, plz re-input nutchuser's password."
    185 #    fi
    186 #done
    187 
    188 #unset Nutchuser_Passwd2
    189187
    190188if [ $(cat /etc/passwd | grep nutchuser) ]; then
     
    213211function scp_packages(){
    214212echo -e "\n= scp_packages (debug) ="
     213chmod 777 /opt
    215214echo "scp -r -o StrictHostKeyChecking=no nutchuser@$1:/opt/nutchez/ /opt/"
    216 scp -r -o StrictHostKeyChecking=no nutchuser@$1:/opt/nutchez/ /opt/
    217 
    218 echo "chown -R nutchuser:nutchuser /opt/nutchez/"
     215su nutchuser -c "scp -r -o StrictHostKeyChecking=no nutchuser@$1:/opt/nutchez/ /opt/"
     216
     217echo -e "\nchown -R nutchuser:nutchuser /opt/nutchez/"
    219218chown -R nutchuser:nutchuser /opt/nutchez/
    220 }
     219chmod 755 /opt
     220}
Note: See TracChangeset for help on using the changeset viewer.