Commit 7c27aae8 authored by daidekun's avatar daidekun

增加public ip

parent 0a0fac50
......@@ -9,6 +9,9 @@
database_name=$1
server_host=$2
db_sub_backup_folder=$3
re_replace_ip=$4
public_ip="139.198.2.95"
ip_last=$5
echo $server_host
cd $db_sub_backup_folder
......@@ -50,4 +53,12 @@ do
sed -i "s/https\:\/\/gyxdapi.xyqb.com/http\:\/\/${server_host}:7029/g" $entry
sed -i "s/http\:\/\/btapi.xyqb.com/http\:\/\/${server_host}:7025/g" $entry
sed -i "s/https\:\/\/btapi.xyqb.com/http\:\/\/${server_host}:7025/g" $entry
done
\ No newline at end of file
done
if [ "$re_replace_ip" = true ]; then
for entry in ./*
do
echo "is replace ip for $entry"
sed -i "s/\:70/${ip_last}:/g" $entry
done
fi
\ No newline at end of file
......@@ -20,7 +20,8 @@ if [ $# -ne 7 ]; then
exit 1
fi
source_db_host="$1"
ip_last=$1
source_db_host="192.168.4.${$ip_last}"
source_db_user=$2
source_db_pwd='Uiwb@o^fR&nHOa5t'
......@@ -50,8 +51,9 @@ function db_schema_sync()
sh $work_dir/db_gen_config.sh $source_db_host $source_db_user $source_db_pwd $target_db_host $target_db_user $target_db_pwd $database $config_file_name $db_backup_sub_folders
echo "Step 2: replace domain name in tables: $database $mysql_host $db_backup_sub_folders"
sh $work_dir/db_replace_ip.sh $database $target_db_host $db_backup_sub_folders
echo "Step 2.1: is re_replace_ip: $re_replace_ip"
sh $work_dir/db_replace_ip.sh $database $target_db_host $db_backup_sub_folders $re_replace_ip $ip_last
echo "Step 3: import basic data from backup file: $database $mysql_host $db_backup_sub_folders"
sh $work_dir/db_import.sh $database $target_db_host $db_backup_sub_folders
......
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