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
0a48aa80
Commit
0a48aa80
authored
Nov 23, 2017
by
qa_quantgroup
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
063e2558
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
45 deletions
+0
-45
aaa.sh
db-utils/aaa.sh
+0
-45
No files found.
db-utils/aaa.sh
deleted
100644 → 0
View file @
063e2558
# -------------------------------------------------------------------------------
# Filename: db_replace_ip.sh
# Revision: 1.1
# Date: 2017/02
# Author: dekun.dai
# Description: 该脚本根据备份sql称特定环境使用的sql
# Usage:used by ../deploy/db_replace_ip.sh
# -------------------------------------------------------------------------------
database_name
=
$1
server_host
=
$2
db_sub_backup_folder
=
$3
re_replace_ip
=
$4
public_ip
=
"www.q-gp.com"
ip_last
=
$5
pwd_path
=
"/home/qa-deploy-utils/qa_shell_script"
config_server
=
"
$pwd_path
/config_server"
echo
$server_host
cd
$db_sub_backup_folder
file_count
=
`
ls
-l
|grep
"^-"
|wc
-l
`
function
trancsHostName
()
{
if
[
"
$4
"
=
true
]
;
then
sed
-i
"s/
$2
/
$3
-
$7
.q-gp.com/g"
$5
else
sed
-i
"s/
$2
/
$6
:
$1
/g"
$5
fi
}
echo
"./* file count is
$file_count
"
if
[
"
$file_count
"
-gt
0
]
;
then
for
entry
in
./
*
do
sed
-i
"s/https/http/g"
$entry
echo
"is replace ip for db_back_file
$entry
"
var
=
`
cat
$config_server
/get_project_host.sh
`
for
v
in
${
var
[@]
}
do
i
=
${
v
//|/
}
trancsHostName i
$re_replace_ip
$entry
${
server_host
}
${
ip_last
}
done
done
fi
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