You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
820 B

  1. #!/usr/bin/env sh
  2. ##
  3. ## Input parameters
  4. ##
  5. BINARY=/tendermint/${BINARY:-tendermint}
  6. ID=${ID:-0}
  7. LOG=${LOG:-tendermint.log}
  8. ##
  9. ## Assert linux binary
  10. ##
  11. if ! [ -f "${BINARY}" ]; then
  12. echo "The binary $(basename "${BINARY}") cannot be found. Please add the binary to the shared folder. Please use the BINARY environment variable if the name of the binary is not 'tendermint' E.g.: -e BINARY=tendermint_my_test_version"
  13. exit 1
  14. fi
  15. BINARY_CHECK="$(file "$BINARY" | grep 'ELF 64-bit LSB executable, x86-64')"
  16. if [ -z "${BINARY_CHECK}" ]; then
  17. echo "Binary needs to be OS linux, ARCH amd64"
  18. exit 1
  19. fi
  20. ##
  21. ## Run binary with all parameters
  22. ##
  23. export TMHOME="/tendermint/node${ID}"
  24. if [ -d "`dirname ${TMHOME}/${LOG}`" ]; then
  25. "$BINARY" "$@" | tee "${TMHOME}/${LOG}"
  26. else
  27. "$BINARY" "$@"
  28. fi
  29. chmod 777 -R /tendermint