confgen.sh 1.0 KB

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