blob: 33e09cf223607e5499a5339c83d6bb544cd75185 [file] [log] [blame]
刘洪青2fdb2cb2020-10-09 15:07:18 +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/admin-center-poa.v1.yaml" "POA_SERVER_URL" "$POA_SERVER_URL"
15 fi
16
刘洪青3ecc5212020-10-13 00:24:25 +080017 # if [ -n "$POA_SA_SERVER_URL" ]; then
18 # replace_file "/root/poa-api-docs/exec.sh" "POA_SA_SERVER_URL" "$POA_SA_SERVER_URL"
19 # fi
20
刘洪青2fdb2cb2020-10-09 15:07:18 +080021 set -ex;
22 exec /root/poa-api-docs/exec.sh
23else
24 set -ex;
25 exec "$@"
26fi