#!/bin/bash ##################################################### # Name: change_nginx_upstream_conf.sh # Version: V1.0 # Author: 运维菜鸟 # Description: 更改nginx upstream配置文件 # Create Date: 2017-07-03 # Email: ##################################################### #function name function_name=$1 #pool name pool_name=$2 #pool corresponding ip list pool_ip_lists=$3 #pool corresponding tomcat port pool_tomcat_port=$4 #upstream file location ngx_upstream_file=$5 #检测pool在nginx upstream配置文件中是否存在 function check_pool_in_ngx_upstream() { grep -E "${pool_name}[^-]" ${ngx_upstream_file} >> /dev/null if [ $? -eq 0 ];then echo -e "