Changeset 134 for nutchez-0.2/src/test/client_install_func.sh
- Timestamp:
- May 28, 2010, 4:05:38 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
nutchez-0.2/src/test/client_install_func.sh
r133 r134 148 148 echo -e "mkdir -p /home/nutchuser/" 149 149 mkdir -p /home/nutchuser/ 150 rm -fr /home/nutchuser/.ssh 150 151 151 152 while [ ! -d "/home/nutchuser/.ssh" ] 153 do 154 while [ "$Nutchuser_Passwd" != "$Nutchuser_Passwd2" ] 152 155 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 155 168 echo -e "scp nutchuser@$1:~/.ssh /home/nutchuser/" 156 169 expect -c "spawn scp -r -o StrictHostKeyChecking=no nutchuser@$1:~/.ssh /home/nutchuser/ 157 170 expect \"*: \" { send \"$Nutchuser_Passwd\r\" } 158 expect \"*: \" { send_user \"Passw d is error\" }171 expect \"*: \" { send_user \"Password is error\" } 159 172 expect eof" 160 173 if [ ! -d "/home/nutchuser/.ssh" ]; then 161 echo -e "\nPassw dis error, plz re-input nutchuser passwd of master node."174 echo -e "\nPassword is error, plz re-input nutchuser passwd of master node." 162 175 else 163 176 echo -e "\nscp correct." … … 172 185 function creat_nutchuser_account(){ 173 186 echo -e "\n= creat_nutchuser_account (debug) =" 174 175 # 若沒 nutchuser_Passwd 的參數傳遞才將註解打開讓使用者字型輸入176 #while [ "1" != "$Nutchuser_Passwd2" ]177 #do178 # read -p "Create nutchuser, plz input nutchuser's password: " Nutchuser_Passwd179 # read -p "plz input nutchuser's password, again: " Nutchuser_Passwd2180 181 # if [ "$1" == "$Nutchuser_Passwd2" ]; then182 # echo "Two Passwords match."183 # else184 # echo "two passwords do not match, plz re-input nutchuser's password."185 # fi186 #done187 188 #unset Nutchuser_Passwd2189 187 190 188 if [ $(cat /etc/passwd | grep nutchuser) ]; then … … 213 211 function scp_packages(){ 214 212 echo -e "\n= scp_packages (debug) =" 213 chmod 777 /opt 215 214 echo "scp -r -o StrictHostKeyChecking=no nutchuser@$1:/opt/nutchez/ /opt/" 216 s cp -r -o StrictHostKeyChecking=no nutchuser@$1:/opt/nutchez/ /opt/217 218 echo "chown -R nutchuser:nutchuser /opt/nutchez/"215 su nutchuser -c "scp -r -o StrictHostKeyChecking=no nutchuser@$1:/opt/nutchez/ /opt/" 216 217 echo -e "\nchown -R nutchuser:nutchuser /opt/nutchez/" 219 218 chown -R nutchuser:nutchuser /opt/nutchez/ 220 } 219 chmod 755 /opt 220 }
Note: See TracChangeset
for help on using the changeset viewer.