blob: 8385b0870f944a6d6b85f081bd99d77998bd713a [file] [log] [blame]
刘洪青47205852020-08-14 13:39:30 +08001#!/bin/sh
2
3replace_file() {
4 local file="$1"
5 local key="$2"
6 local value="$3"
7 sed -i "s;\${$key};$value;" $file
8}
9
10# 如果第一个参数是app,那么就启动执行nginx
11if [ "$1" = 'app' ]; then
12
13 if [ -n "$POA_SERVER_URL" ]; then
14 replace_file "/root/poa-api-docs/user-data-service-poa.v1.yaml" "POA_SERVER_URL" "$POA_SERVER_URL"
刘洪青6b495a42020-11-16 16:28:40 +080015 replace_file "/root/poa-api-docs/user-data-service-thirdparty-poa.v1.yaml" "POA_SERVER_URL" "$POA_SERVER_URL"
刘洪青47205852020-08-14 13:39:30 +080016 replace_file "/root/poa-api-docs/user-authorization-service-poa.v1.yaml" "POA_SERVER_URL" "$POA_SERVER_URL"
刘洪青47205852020-08-14 13:39:30 +080017 replace_file "/root/poa-api-docs/communicate-center-poa.v1.yaml" "POA_SERVER_URL" "$POA_SERVER_URL"
18 fi
19
刘洪青b42034e2020-10-13 00:25:42 +080020 # if [ -n "$POA_SA_SERVER_URL" ]; then
21 # replace_file "/root/poa-api-docs/exec.sh" "POA_SA_SERVER_URL" "$POA_SA_SERVER_URL"
22 # fi
23
刘洪青47205852020-08-14 13:39:30 +080024 set -ex;
25 exec /root/poa-api-docs/exec.sh
26else
27 set -ex;
28 exec "$@"
29fi