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
32ac4c40
Commit
32ac4c40
authored
Jun 19, 2018
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
q-gp
parent
5c2494de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
db_replace_ip.sh
db-utils/db_replace_ip.sh
+7
-7
No files found.
db-utils/db_replace_ip.sh
View file @
32ac4c40
...
@@ -10,7 +10,7 @@ database_name=$1
...
@@ -10,7 +10,7 @@ database_name=$1
server_host
=
$2
server_host
=
$2
db_sub_backup_folder
=
$3
db_sub_backup_folder
=
$3
re_replace_ip
=
$4
re_replace_ip
=
$4
public_ip
=
"www.
q-gp
.com"
public_ip
=
"www.
liangkebang
.com"
ip_last
=
$5
ip_last
=
$5
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"
...
@@ -26,8 +26,8 @@ hosts=`node $config_server/get_project_config.js -type multi -attr port/url -att
...
@@ -26,8 +26,8 @@ hosts=`node $config_server/get_project_config.js -type multi -attr port/url -att
function
transByPort
()
function
transByPort
()
{
{
if
[
-n
"
$4
"
]
;
then
if
[
-n
"
$4
"
]
;
then
echo
"sed -i
\"
s/
\/
$3
.xyqb.com/
\/
$1
-
$ip_last
.
q-gp
.com/g
\"
$4
"
echo
"sed -i
\"
s/
\/
$3
.xyqb.com/
\/
$1
-
$ip_last
.
liangkebang
.com/g
\"
$4
"
sed
-i
"s/
\/
$3
.xyqb.com/
\/
$1
-
$ip_last
.
q-gp
.com/g"
$4
sed
-i
"s/
\/
$3
.xyqb.com/
\/
$1
-
$ip_last
.
liangkebang
.com/g"
$4
fi
fi
}
}
...
@@ -68,8 +68,8 @@ if [ $database_name = 'mall' ];then
...
@@ -68,8 +68,8 @@ if [ $database_name = 'mall' ];then
done
done
else
else
echo
"replace
$re_replace_ip
ip for
$entry
.sql"
echo
"replace
$re_replace_ip
ip for
$entry
.sql"
echo
"sed -i "
s#
\.
xyqb
\.
com#-
${
re_replace_ip
}
.
q-gp
.com#g
"
$entry
.sql"
echo
"sed -i "
s#
\.
xyqb
\.
com#-
${
re_replace_ip
}
.
liangkebang
.com#g
"
$entry
.sql"
sed
-i
"s#
\.
xyqb
\.
com#-
${
re_replace_ip
}
.
q-gp
.com#g"
$entry
.sql
sed
-i
"s#
\.
xyqb
\.
com#-
${
re_replace_ip
}
.
liangkebang
.com#g"
$entry
.sql
fi
fi
done
done
else
else
...
@@ -90,8 +90,8 @@ else
...
@@ -90,8 +90,8 @@ else
done
done
else
else
echo
"replace
$re_replace_ip
ip for
$db_sub_backup_folder
/*"
echo
"replace
$re_replace_ip
ip for
$db_sub_backup_folder
/*"
echo
"sed -i "
s#
\.
xyqb
\.
com#-
${
re_replace_ip
}
.
q-gp
.com#g
"
$db_sub_backup_folder
/*"
echo
"sed -i "
s#
\.
xyqb
\.
com#-
${
re_replace_ip
}
.
liangkebang
.com#g
"
$db_sub_backup_folder
/*"
sed
-i
"s#
\.
xyqb
\.
com#-
${
re_replace_ip
}
.
q-gp
.com#g"
$db_sub_backup_folder
/
*
sed
-i
"s#
\.
xyqb
\.
com#-
${
re_replace_ip
}
.
liangkebang
.com#g"
$db_sub_backup_folder
/
*
#for host in $hosts
#for host in $hosts
#do
#do
# arr=${host//|/ }
# arr=${host//|/ }
...
...
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