github.com/Finschia/finschia-sdk@v0.48.1/contrib/images/simd-env/wrapper.sh (about)

     1  #!/usr/bin/env sh
     2  set -euo pipefail
     3  set -x
     4  
     5  BINARY=/simd/${BINARY:-simd}
     6  ID=${ID:-0}
     7  LOG=${LOG:-simd.log}
     8  
     9  if ! [ -f "${BINARY}" ]; then
    10  	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 'simd'"
    11  	exit 1
    12  fi
    13  
    14  export SIMDHOME="/data/node${ID}/simd"
    15  
    16  if [ -d "$(dirname "${SIMDHOME}"/"${LOG}")" ]; then
    17    "${BINARY}" --home "${SIMDHOME}" "$@" | tee "${SIMDHOME}/${LOG}"
    18  else
    19    "${BINARY}" --home "${SIMDHOME}" "$@"
    20  fi