forked from open-falcon/falcon-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
confgen.sh
36 lines (33 loc) · 1.02 KB
/
confgen.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
confs=(
'%%AGENT_HTTP%%=0.0.0.0:1988'
'%%AGGREGATOR_HTTP%%=0.0.0.0:6055'
'%%GRAPH_HTTP%%=0.0.0.0:6071'
'%%GRAPH_RPC%%=0.0.0.0:6070'
'%%HBS_HTTP%%=0.0.0.0:6031'
'%%HBS_RPC%%=0.0.0.0:6030'
'%%JUDGE_HTTP%%=0.0.0.0:6081'
'%%JUDGE_RPC%%=0.0.0.0:6080'
'%%NODATA_HTTP%%=0.0.0.0:6090'
'%%TRANSFER_HTTP%%=0.0.0.0:6060'
'%%TRANSFER_RPC%%=0.0.0.0:8433'
'%%REDIS%%=127.0.0.1:6379'
'%%MYSQL%%=root:@tcp(127.0.0.1:3306)'
'%%PLUS_API_DEFAULT_TOKEN%%=default-token-used-in-server-side'
'%%PLUS_API_HTTP%%=0.0.0.0:8080'
)
configurer() {
for i in "${confs[@]}"
do
search="${i%%=*}"
replace="${i##*=}"
uname=`uname`
if [ "$uname" == "Darwin" ] ; then
# Note the "" and -e after -i, needed in OS X
find ./out/*/config/*.json -type f -exec sed -i .tpl -e "s/${search}/${replace}/g" {} \;
else
find ./out/*/config/*.json -type f -exec sed -i "s/${search}/${replace}/g" {} \;
fi
done
}
configurer