#!/bin/bash help(){ echo "eg: $0 [old-string] [new-string] [old-dbType] [new-dbType]" echo "" exit 1 } if [ ! -n "$1" ] ; then help fi if [ ! -n "$2" ] ; then help fi if [ ! -n "$3" ] ; then help fi if [ ! -n "$4" ] ; then help fi old_string=$1 new_string=$2 old_db_type=$3 new_db_type=$4 c_home=$(cd `dirname $0`; pwd) # 授权文件检查 is_empty_dir(){ return `ls -A $1|wc -w` } # ./license if is_empty_dir ${c_home}/license then echo "No license file!" echo "" exit 1 fi if [ ! -f "${c_home}/license/ibpsPublic.store" ];then echo "No ibpsPublic.store license file!" echo "" exit 1 fi if [ ! -f "${c_home}/license/ibpsVfy.lic" ];then echo "No ibpsVfy.lic license file!" echo "" exit 1 fi # [后端网关IP]:[端口] sh ui.sh ${old_string}:15100 ${new_string}:35100 sh ui-app.sh ${old_string}:15100 ${new_string}:35100 # [后端platform服务IP]:[socket端口] sh ui.sh ${old_string}:15888 ${new_string}:35888 sh ui-app.sh ${old_string}:15888 ${new_string}:35888 sed -i "s/${old_string}/${new_string}/g" ${c_home}/docker-compose-data.yml sed -i "s/${old_string}/${new_string}/g" ${c_home}/conf/kibana.yml sed -i "s/${old_string}/${new_string}/g" ${c_home}/conf/logstash.conf sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-mysql-bpmn.xml sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-mssql-bpmn.xml sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-oracle-bpmn.xml sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-postgres-bpmn.xml sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-mysql-form.xml sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-mssql-form.xml sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-oracle-form.xml sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-postgres-form.xml sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-mysql-business.xml sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-mssql-business.xml sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-oracle-business.xml sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-postgres-business.xml sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-mysql-platform.xml sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-mssql-platform.xml sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-oracle-platform.xml sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-postgres-platform.xml sed -i "s/${old_string}/${new_string}/g" ${c_home}/env/ibps.sw.env sed -i "s/${old_string}/${new_string}/g" ${c_home}/env/platform.docker.env sed -i "s/${old_string}/${new_string}/g" ${c_home}/env/boot.docker.env sed -i "s/${old_string}/${new_string}/g" ${c_home}/env/provider.docker.env sed -i "s/${old_string}/${new_string}/g" ${c_home}/env/sw-oap.env sed -i "s/${old_string}/${new_string}/g" ${c_home}/env/sw-ui.env sed -i "s/${old_string}/${new_string}/g" ${c_home}/env/sw-ui.env sed -i "s/${old_db_type}/${new_db_type}/g" ${c_home}/env/provider.docker.env sed -i "s/${old_db_type}/${new_db_type}/g" ${c_home}/docker-compose-app.yml