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
f5b8764f
Commit
f5b8764f
authored
Dec 07, 2017
by
tywldx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改mount的IP获取方式
parent
1ee7df8b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
42 deletions
+44
-42
1_mount_config_files.sh
qa_shell_script/1_mount_config_files.sh
+44
-42
No files found.
qa_shell_script/1_mount_config_files.sh
View file @
f5b8764f
#!/bin/bash
#!/bin/bash
target_ip
=
$1
target_ip
=
$1
IP_host_first
=
"192.168.4."
pwd_path_0
=
"/home/qa-deploy-utils"
target_db_host
=
`
sh
$pwd_path
/get-ip.sh
$ip_value
`
config_files
=
/home/config_files
config_files
=
/home/config_files
script_path
=
/home/qa-deploy-utils/qa_shell_script
script_path
=
/home/qa-deploy-utils/qa_shell_script
pwd_path
=
"/home/qa-deploy-utils/qa_shell_script"
pwd_path
=
"/home/qa-deploy-utils/qa_shell_script"
config_server
=
"
$pwd_path
/config_server"
config_server
=
"
$pwd_path
/config_server"
project_path
=
`
cat
$config_server
/get_env_ip.sh
`
project_path
=
`
cat
$config_server
/get_env_ip.sh
`
if
[[
$target_ip
==
"ALL"
]]
;
then
if
[[
$target_ip
==
"ALL"
]]
;
then
for
ip_last_num
in
$project_path
for
ip_last_num
in
$project_path
do
do
IP_host
=
`
sh
$pwd_path_0
/get-ip.sh
$ip_last_num
`
expect
-c
"
expect
-c
"
set timeout 10
set timeout 10
spawn ssh root@
${
IP_host_first
}${
ip_last_num
}
spawn ssh root@
${
IP_host
}
expect
\"
]#
\"
expect
\"
]#
\"
send
\"
umount -l
$script_path
\\
\r\"
send
\"
umount -l
$script_path
\\
\r\"
set timeout -1
set timeout -1
...
@@ -36,16 +37,17 @@ if [[ $target_ip == "ALL" ]]; then
...
@@ -36,16 +37,17 @@ if [[ $target_ip == "ALL" ]]; then
send
\"
mkdir
$config_files
\r\"
send
\"
mkdir
$config_files
\r\"
set timeout -1
set timeout -1
expect
\"
]#
\"
expect
\"
]#
\"
send
\"
mount -t nfs 192.168.4.3:/home/sub_config_file_dont_rm/
${
IP_host_first
}${
ip_last_num
}
/
$config_files
\r\"
send
\"
mount -t nfs 192.168.4.3:/home/sub_config_file_dont_rm/
${
IP_host
}
/
$config_files
\r\"
set timeout -1
set timeout -1
expect
\"
]#
\"
expect
\"
]#
\"
send
\"
exit
\r\"
send
\"
exit
\r\"
expect eof;"
expect eof;"
done
done
else
else
target_host
=
`
sh
$pwd_path_0
/get-ip.sh
$target_ip
`
expect
-c
"
expect
-c
"
set timeout 10
set timeout 10
spawn ssh root@
${
IP_host_first
}${
target_ip
}
spawn ssh root@
${
target_host
}
expect
\"
]#
\"
expect
\"
]#
\"
send
\"
umount -l /home/qa-deploy-utils/qa_shell_script
\r\"
send
\"
umount -l /home/qa-deploy-utils/qa_shell_script
\r\"
expect
\"
]#
\"
expect
\"
]#
\"
...
@@ -64,7 +66,7 @@ else
...
@@ -64,7 +66,7 @@ else
send
\"
mkdir
$config_files
\r\"
send
\"
mkdir
$config_files
\r\"
set timeout -1
set timeout -1
expect
\"
]#
\"
expect
\"
]#
\"
send
\"
mount -t nfs 192.168.4.3:/home/sub_config_file_dont_rm/
${
IP_host_first
}${
target_ip
}
/
$config_files
\r\"
send
\"
mount -t nfs 192.168.4.3:/home/sub_config_file_dont_rm/
${
target_host
}
/
$config_files
\r\"
set timeout -1
set timeout -1
expect
\"
]#
\"
expect
\"
]#
\"
send
\"
exit
\r\"
send
\"
exit
\r\"
...
...
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