#!/bin/bash
base_path=/home/sub_config_file_dont_rm
function tranceConfig()
{
	type_=$1
	source_str=$2
	target_str=$3
	ip_host=$4
	file_name=$5
	echo "
	source_str: $source_str
	target_str: $target_str
	ip_host: $ip_host
	file_name: $file_name
	"
	if [ "$type_" = "java" ]
	then
		sed -i "N;s#$source_str#$target_str#g"  $base_path/$ip_host/java/$file_name
		sed -i "N;s#$source_str#$target_str#g"  $base_path/$ip_host/public/java/$file_name

	elif [ "$type_" = "ui" ]
	then
		sed -i "N;s#$source_str#$target_str#g"  $base_path/$ip_host/ui/$file_name
		sed -i "N;s#$source_str#$target_str#g"  $base_path/$ip_host/public/ui/$file_name
	elif [ "$type_" = "python" ]
	then
		sed -i "N;s#$source_str#$target_str#g"  $base_path/$ip_host/python/$file_name

	elif [ "$type_" = "node" ]
	then
		sed -i "N;s#$source_str#$target_str#g"  $base_path/$ip_host/node/$file_name

        elif [ "$type_" = "nginx" ]
        then    
                sed -i "N;s#$source_str#$target_str#g"  $base_path/$ip_host/nginx_conf.d/$file_name
        fi
}

#end

