sed -i "/pro_monitor_ip_$pro_monitor_ser/ {s#$tmp_pro_monitor_ip#$pro_monitor_ip#g}" ~/.bash_profile
sed -i "/pro_monitor_port_$pro_monitor_ser/ {s#$tmp_pro_monitor_port#$pro_monitor_port#g}" ~/.bash_profile
fi
sed -i "/pro_monitor_serlist/ {s#$pro_monitor_serlist#$pro_monitor_ser $pro_monitor_serlist#g}" ~/.bash_profile
done
fi
#测试环境
echo "检测[$xiangmu],测试环境架构配置..."
#判断测试环境是否在本地
if [ -z "$remote_test" ]
then
monitor_ip=`cat $test_path/ierp/bin/prop.xml |grep '<address>' | awk -F '>' '{print $2}' | awk -F '<' '{print $1}'`
monitor_port=`cat $test_path/ierp/bin/prop.xml |grep '<port>' | awk -F '>' '{print $2}' | awk -F '<' '{print $1}'`
if [ -z "$monitor_ip" ]
then
monitor_ip=localhost
fi
#判断是新插入还是更新
issetmonitor_ip=`cat ~/.bash_profile |grep test_monitor_ip`
if [ -z "$issetmonitor_ip" ]
then
echo "$xiangmu测试环境监控IP未配置,进行初始化配置.."
echo "export test_monitor_ip=$monitor_ip" >> ~/.bash_profile
else
echo "更新$xiangmu测试环境监控IP配置..."
sed -i "/test_monitor_ip/ {s#$test_monitor_ip#$monitor_ip#g}" ~/.bash_profile
fi
#判断是新插入还是更新
issetmonitor_port=`cat ~/.bash_profile |grep test_monitor_port`
if [ -z "$issetmonitor_port" ]
then
echo "$xiangmu测试环境监控端口未配置,进行初始化配置.."
echo "export test_monitor_port=$monitor_port" >> ~/.bash_profile
else
echo "更新$xiangmu生产环境监控端口配置..."
sed -i "/test_monitor_port/ {s#$test_monitor_port#$monitor_port#g}" ~/.bash_profile
fi
else
#测试环境不在本机,则取已设置的环境变量
monitor_ip=$remote_test
monitor_port=$test_port
if [ -z "$monitor_ip" ]
then
monitor_ip=localhost
fi
#判断是新插入还是更新
issetmonitor_ip=`cat ~/.bash_profile |grep test_monitor_ip`
if [ -z "$issetmonitor_ip" ]
then
echo "$xiangmu测试环境监控IP未配置,进行初始化配置.."
echo "export test_monitor_ip=$monitor_ip" >> ~/.bash_profile
else
echo "更新$xiangmu测试环境监控IP配置..."
sed -i "/test_monitor_ip/ {s#$test_monitor_ip#$monitor_ip#g}" ~/.bash_profile
fi
#判断是新插入还是更新
issetmonitor_port=`cat ~/.bash_profile |grep test_monitor_port`
if [ -z "$issetmonitor_port" ]
then
echo "$xiangmu测试环境监控端口未配置,进行初始化配置.."
echo "export test_monitor_port=$monitor_port" >> ~/.bash_profile
else
echo "更新$xiangmu生产环境监控端口配置..."
sed -i "/test_monitor_port/ {s#$test_monitor_port#$monitor_port#g}" ~/.bash_profile
fi
1 个回复
nccloud