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
55706a97
Commit
55706a97
authored
Oct 15, 2017
by
qa_quantgroup
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
45d843e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
sub_shell.sh
qa_shell_script/sub_shell.sh
+21
-4
No files found.
qa_shell_script/sub_shell.sh
View file @
55706a97
#!/bin/bash
#!/bin/bash
scriptname
=
$(
basename
$0
)
lock
=
"/var/run/
${
scriptname
}
"
exec
200>
$lock
#flock -n 200 || echo "sub.sh 正在被其他人执行,请稍后再试" && exit 1
#flock -n 200 || exit 1
flock
-n
200
if
[
$?
-ne
0
]
;
then
echo
"
$scriptname
正在被其他人执行,预计一分钟,请稍后再试~"
exit
1
fi
## The code:
pid
=
$$
echo
$pid
1>&200
IP_host_first
=
"192.168.4."
IP_host_first
=
"192.168.4."
public_ip
=
"q-gp.com"
#"139.198.2.95"
public_ip
=
"q-gp.com"
#"139.198.2.95"
pwd_path
=
"/home/qa-deploy-utils/qa_shell_script"
pwd_path
=
"/home/qa-deploy-utils/qa_shell_script"
...
@@ -20,14 +37,14 @@ do
...
@@ -20,14 +37,14 @@ do
echo
>
&1000
echo
>
&1000
done
done
echo
"共要生成
$counts
个环境的配置文件"
echo
"共要生成
$counts
个环境的配置文件"
echo
"并发生成6个环境
,最大负载
4~"
echo
"并发生成6个环境
的配置文,负载最大时为
4~"
#for ip_last_num in '15'
#for ip_last_num in '15'
for
ip_last_num
in
${
ips
[@]
}
for
ip_last_num
in
${
ips
[@]
}
do
do
read
-u1000
read
-u1000
{
{
echo
"
开始生成
${
IP_host_first
}${
ip_last_num
}
"
echo
"
`
date
+%T:%N
`
开始生成
${
IP_host_first
}${
ip_last_num
}
"
cd
/home/sub_config_file_dont_rm
cd
/home/sub_config_file_dont_rm
mkdir
-p
${
IP_host_first
}${
ip_last_num
}
mkdir
-p
${
IP_host_first
}${
ip_last_num
}
cd
${
IP_host_first
}${
ip_last_num
}
cd
${
IP_host_first
}${
ip_last_num
}
...
@@ -101,7 +118,7 @@ do
...
@@ -101,7 +118,7 @@ do
mkdir
-p
$dir
/pem_file
mkdir
-p
$dir
/pem_file
cp
-rf
/home/config_files/pem_file/
*
$dir
/pem_file/
cp
-rf
/home/config_files/pem_file/
*
$dir
/pem_file/
# sed -i "s/target_host_name/${IP_host_first}${ip_last_num}/" $dir/nginx_conf.d/*
# sed -i "s/target_host_name/${IP_host_first}${ip_last_num}/" $dir/nginx_conf.d/*
echo
"
结束
${
IP_host_first
}${
ip_last_num
}
"
echo
"
`
date
+%T:%N
`
结束
${
IP_host_first
}${
ip_last_num
}
"
echo
"---------"
echo
"---------"
echo
>
&1000
echo
>
&1000
}
&
}
&
...
...
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