Commit fac1b179 authored by QA-甘 盛聪's avatar QA-甘 盛聪

update

parent afebca90
#!/bin/bash
#IP_host_first="192.168.4."
#config_files=/home/config_files
#umount $config_files
#rm -rf $config_files
#mkdir $config_files
#ip_add=`/sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"`
#mount -t nfs 192.168.4.3:/home/sub_config_file_dont_rm/${ip_add}/ $config_files
#for ip_last_num in 12 13 14 15 16 17 24 151
#do
# ssh root@${IP_host_first}${ip_last_num}
# if [ $? = 0 ]; then
# echo "ssh ${IP_host_first}${ip_last_num} is ok".
# mkdir -p /home/qa-deploy-utils/qa_shell_script
# mount -t nfs 192.168.4.3:/home/qa-deploy-utils/qa_shell_script /home/qa-deploy-utils/qa_shell_script
# else
# echo "Fail to ssh ${IP_host_first}${ip_last_num}".
# exit -1
# fi
#done
#!/bin/bash
IP_host_first="192.168.4."
config_files=/home/config_files
umount $config_files
rm -rf $config_files
mkdir $config_files
ip_add=`/sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"`
mount -t nfs 192.168.4.3:/home/sub_config_file_dont_rm/${ip_add}/ $config_files
\ No newline at end of file
for ip_last_num in 12 13 14 15 16 17 24 151
do
expect -c "
set timeout 10
spawn ssh root@${IP_host_first}${ip_last_num}
expect *ssword* { send !QAZ2wsx\r }
expect \"]#\"
send \"mkdir -p /home/qa-deploy-utils/qa_shell_script\r\"
set timeout -1
expect \"]#\"
send \"mount -t nfs 192.168.4.3:/home/qa-deploy-utils/qa_shell_script /home/qa-deploy-utils/qa_shell_script\r\"
set timeout -1
expect \"]#\"
send \"umount $config_files\r\"
set timeout -1
expect \"]#\"
send \"rm -rf $config_files\r\"
set timeout -1
expect \"]#\"
send \"mkdir $config_files\r\"
set timeout -1
expect \"]#\"
send \"mount -t nfs 192.168.4.3:/home/sub_config_file_dont_rm/${IP_host_first}${ip_last_num}/ $config_files\r\"
set timeout -1
expect \"]#\"
send \"exit\r\"
expect eof;"
done
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment