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
7abe5bc5
Commit
7abe5bc5
authored
Nov 24, 2017
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
只替换mall数据库的配置表
parent
fdd9a1f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
10 deletions
+40
-10
db_replace_ip.sh
db-utils/db_replace_ip.sh
+40
-10
No files found.
db-utils/db_replace_ip.sh
View file @
7abe5bc5
...
@@ -49,25 +49,55 @@ function transByUrl()
...
@@ -49,25 +49,55 @@ function transByUrl()
# fi
# fi
# }
# }
echo
"./* file count is
$file_count
"
if
[
$database_name
=
'mall'
]
;
then
if
[
"
$file_count
"
-gt
0
]
;
then
config_table
=
'admin_banner album category_banner faster_entrance life_service'
for
entry
in
$config_table
for
entry
in
./
*
do
do
sed
-i
"s/https
\:
/http
\:
/g"
$entry
sed
-i
"s/https
\:
/http
\:
/g"
$entry
.sql
if
[
"
$re_replace_ip
"
=
true
]
;
then
if
[
"
$re_replace_ip
"
=
true
]
;
then
echo
"replace public ip for
$entry
"
echo
"replace public ip for
$entry
.sql
"
for
host
in
$hosts
for
host
in
$hosts
do
do
arr
=
${
host
//|/
}
arr
=
${
host
//|/
}
transByPort
$arr
$entry
transByPort
$arr
$entry
.sql
done
done
elif
[
"
$re_replace_ip
"
=
false
]
;
then
elif
[
"
$re_replace_ip
"
=
false
]
;
then
echo
"replace ip for
$entry
"
echo
"replace ip for
$entry
.sql
"
for
host
in
$hosts
for
host
in
$hosts
do
do
arr
=
${
host
//|/
}
arr
=
${
host
//|/
}
transByUrl
$arr
$entry
transByUrl
$arr
$entry
.sql
done
else
echo
"replace
$re_replace_ip
ip for
$entry
.sql"
echo
"sed -i "
s#.xyqb.com#-
${
re_replace_ip
}
.q-gp.com#g
"
$entry
.sql"
sed
-i
"s#.xyqb.com#-
${
re_replace_ip
}
.q-gp.com#g"
$entry
.sql
fi
done
else
echo
"./* file count is
$file_count
"
if
[
"
$file_count
"
-gt
0
]
;
then
sed
-i
"s/https
\:
/http
\:
/g"
$entry
if
[
"
$re_replace_ip
"
=
true
]
;
then
for
entry
in
./
*
do
echo
"replace public ip for
$entry
"
for
host
in
$hosts
do
arr
=
${
host
//|/
}
transByPort
$arr
$entry
done
done
elif
[
"
$re_replace_ip
"
=
false
]
;
then
for
entry
in
./
*
do
echo
"replace ip for
$entry
"
for
host
in
$hosts
do
arr
=
${
host
//|/
}
transByUrl
$arr
$entry
done
done
done
else
else
echo
"replace
$re_replace_ip
ip for
$entry
"
echo
"replace
$re_replace_ip
ip for
$entry
"
...
@@ -79,7 +109,7 @@ if [ "$file_count" -gt 0 ]; then
...
@@ -79,7 +109,7 @@ if [ "$file_count" -gt 0 ]; then
# transByPara $arr $entry $re_replace_ip
# transByPara $arr $entry $re_replace_ip
#done
#done
fi
fi
done
fi
fi
fi
# sed -i "s/\/m.xyqb.com/\/xyqb-ui-$ip_last.q-gp.com/g" $entry
# sed -i "s/\/m.xyqb.com/\/xyqb-ui-$ip_last.q-gp.com/g" $entry
...
...
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