Commit 1d270ca6 authored by 智勇's avatar 智勇

update

parent 1d76b059
...@@ -17,12 +17,9 @@ config_server="$pwd_path/config_server" ...@@ -17,12 +17,9 @@ config_server="$pwd_path/config_server"
project_path=`cat $config_server/project_path.sh` project_path=`cat $config_server/project_path.sh`
config_path=`cat $config_server/config_path.sh` config_path=`cat $config_server/config_path.sh`
echo $server_host echo $server_host
cd $db_sub_backup_folder cd $db_sub_backup_folder
file_count=`ls -l |grep "^-"|wc -l`
hosts=`node $config_server/get_project_config.js -type multi -attr port/url -attr2 true` hosts=`node $config_server/get_project_config.js -type multi -attr port/url -attr2 true`
function transByPort() function transByPort()
...@@ -75,33 +72,30 @@ if [ $database_name = 'mall' ];then ...@@ -75,33 +72,30 @@ if [ $database_name = 'mall' ];then
fi fi
done done
else else
echo "./* file count is $file_count" sed -i "s/https\:/http\:/g" $db_sub_backup_folder/*
if [ "$file_count" -gt 0 ]; then if [ "$re_replace_ip" = true ]; then
sed -i "s/https\:/http\:/g" * echo "replace public ip for $db_sub_backup_folder/*"
if [ "$re_replace_ip" = true ]; then for host in $hosts
echo "replace public ip for $db_sub_backup_folder/*" do
for host in $hosts arr=${host//|/ }
do transByPort $arr "$db_sub_backup_folder/*"
arr=${host//|/ } done
transByPort $arr "$db_sub_backup_folder/*" elif [ "$re_replace_ip" = false ];then
done echo "replace ip for $db_sub_backup_folder/*"
elif [ "$re_replace_ip" = false ];then for host in $hosts
echo "replace ip for $db_sub_backup_folder/*" do
for host in $hosts arr=${host//|/ }
do transByUrl $arr "$db_sub_backup_folder/*"
arr=${host//|/ } done
transByUrl $arr "$db_sub_backup_folder/*" else
done echo "replace $re_replace_ip ip for $db_sub_backup_folder/*"
else echo "sed -i "s#\.xyqb\.com#-${re_replace_ip}.q-gp.com#g" $db_sub_backup_folder/*"
echo "replace $re_replace_ip ip for $db_sub_backup_folder/*" 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}.q-gp.com#g" $db_sub_backup_folder/*" #for host in $hosts
sed -i "s#\.xyqb\.com#-${re_replace_ip}.q-gp.com#g" $db_sub_backup_folder/* #do
#for host in $hosts # arr=${host//|/ }
#do # transByPara $arr $entry $re_replace_ip
# arr=${host//|/ } #done
# transByPara $arr $entry $re_replace_ip
#done
fi
fi fi
fi fi
......
...@@ -93,7 +93,7 @@ function db_schema_sync() ...@@ -93,7 +93,7 @@ function db_schema_sync()
cd $db_backup_sub_folders cd $db_backup_sub_folders
file_count=`ls -l | grep .sql$ | wc -l` file_count=`ls -l | grep .sql$ | wc -l`
echo "./*.sql file count is $file_count" echo "$db_backup_sub_folders/*.sql file count is $file_count"
if [ "$file_count" -gt 0 ]; then if [ "$file_count" -gt 0 ]; then
echo "--- Step 2: replace domain name in tables: $database $db_backup_sub_folders ---" echo "--- Step 2: replace domain name in tables: $database $db_backup_sub_folders ---"
echo "--- Step 2: is re_replace_ip: $re_replace_ip ---" echo "--- Step 2: is re_replace_ip: $re_replace_ip ---"
......
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