Commit 7abe5bc5 authored by 智勇's avatar 智勇

只替换mall数据库的配置表

parent fdd9a1f1
...@@ -49,26 +49,56 @@ function transByUrl() ...@@ -49,26 +49,56 @@ 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
sed -i "s/https\:/http\:/g" $entry.sql
if [ "$re_replace_ip" = true ]; then
echo "replace public ip for $entry.sql"
for host in $hosts
do
arr=${host//|/ }
transByPort $arr $entry.sql
done
elif [ "$re_replace_ip" = false ];then
echo "replace ip for $entry.sql"
for host in $hosts
do do
arr=${host//|/ }
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 sed -i "s/https\:/http\:/g" $entry
if [ "$re_replace_ip" = true ]; then if [ "$re_replace_ip" = true ]; then
for entry in ./*
do
echo "replace public ip for $entry" echo "replace public ip for $entry"
for host in $hosts for host in $hosts
do do
arr=${host//|/ } arr=${host//|/ }
transByPort $arr $entry transByPort $arr $entry
done done
done
elif [ "$re_replace_ip" = false ];then elif [ "$re_replace_ip" = false ];then
for entry in ./*
do
echo "replace ip for $entry" echo "replace ip for $entry"
for host in $hosts for host in $hosts
do do
arr=${host//|/ } arr=${host//|/ }
transByUrl $arr $entry transByUrl $arr $entry
done done
done
else else
echo "replace $re_replace_ip ip for $entry" echo "replace $re_replace_ip ip for $entry"
echo "sed -i "s#.xyqb.com#-${re_replace_ip}.q-gp.com#g" $entry" echo "sed -i "s#.xyqb.com#-${re_replace_ip}.q-gp.com#g" $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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment