Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-deploy-utils
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
qa-deploy-utils
Commits
fac1b179
Commit
fac1b179
authored
Feb 14, 2017
by
QA-甘 盛聪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
afebca90
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
5 deletions
+51
-5
1_mount_config_files.sh
qa_shell_script/1_mount_config_files.sh
+51
-5
No files found.
qa_shell_script/1_mount_config_files.sh
View file @
fac1b179
#!/bin/bash
#!/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
config_files
=
/home/config_files
umount
$config_files
for
ip_last_num
in
12 13 14 15 16 17 24 151
rm
-rf
$config_files
do
mkdir
$config_files
expect
-c
"
ip_add
=
`
/sbin/ifconfig
-a
|grep inet|grep
-v
127.0.0.1|grep
-v
inet6|awk
'{print $2}'
|tr
-d
"addr:"
`
set timeout 10
mount
-t
nfs 192.168.4.3:/home/sub_config_file_dont_rm/
${
ip_add
}
/
$config_files
spawn ssh root@
${
IP_host_first
}${
ip_last_num
}
\ No newline at end of file
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment