confgen4docker.sh 1000 B

1234567891011121314151617181920212223242526272829303132333435
  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. '%%PLUS_API_DEFAULT_TOKEN%%=default-token-used-in-server-side'
  15. '%%PLUS_API_HTTP%%=0.0.0.0:8080'
  16. '%%AGENT_HOSTNAME%%='
  17. )
  18. configurer() {
  19. for i in "${confs[@]}"
  20. do
  21. search="${i%%=*}"
  22. replace="${i##*=}"
  23. uname=`uname`
  24. if [ "$uname" == "Darwin" ] ; then
  25. # Note the "" and -e after -i, needed in OS X
  26. find ./out/*/config/*.json -type f -exec sed -i .tpl -e "s/${search}/${replace}/g" {} \;
  27. else
  28. find ./out/*/config/*.json -type f -exec sed -i "s/${search}/${replace}/g" {} \;
  29. fi
  30. done
  31. }
  32. configurer