Files
shell-scripts/0-部署应用/DNF-私服/CentOS-5.8-VM/修改服务器IP.sh
2024-11-28 16:42:36 +08:00

40 lines
1.4 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
RealIP=10.10.10.146
read_dir(){
for file in `ls -a $1`
do
if [ -d $1"/"$file ]
then
if [[ $file != '.' && $file != '..' ]]
then
read_dir $1"/"$file
fi
else
echo $1"/"$file
echo "开始修改当前文件:$1/$file"
sed -i "s/192.168.200.131/${RealIP}/g" $1"/"$file
echo ""
fi
done
}
#测试目录 test
read_dir /home/dxf
然后连接本地数据库与服务端数据库
本地修改数据库d_taiwan的表geo_allowi字段为allow_ip第一个改为xxx.xxx.xxx.0,第二个改为xxx.xxx.xxx.nn为本地的ip
数据库d_taiwandd的表db_connect字段为allow_ip改为本地ip
数据库d_taiwandd的表dblab_db_connect_130516字段为db_ip的改为本地ip
服务端数据库d_taiwan的表db_connect的ip改为服务器ip
把服务器里的以下文件.cfg与你以前本地或服务器ip一样的修改为现在的如果与以前前三段一样改为现在的前三段。其他的勿动。不会linux命令的可以拖出来用记事本编辑后在拖进去
/home/dxf/auction/cfg/auction_cain.cfg
/home/dxf/point/cfg/point_cain.cfg
/home/dxf/bridge/cfg/bridge.cfg
/home/dxf/dbmw_mnt/cfg/dbmw_mnt_cain.cfg
/home/dxf/monitor/cfg/mnt_cain.cfg
/home/dxf/dbmw_stat/cfg/dbmw_stat_cain.cfg
/home/dxf/relay/cfg/系列
/home/dxf/game/cfg/系列
/home/dxf/dbmw_guild/cfg/dbmw_gld_cain.cfg
/home/dxf/channel/cfg/channel.cfg