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

修改討論後部份功能

File:
1 edited

Legend:

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