2018-04-12 13:15:16 +02:00
#!/usr/bin/env sh
##
## Input parameters
##
BINARY = /tendermint/${ BINARY :- tendermint }
ID = ${ ID :- 0 }
LOG = ${ LOG :- tendermint .log }
##
## Assert linux binary
##
if ! [ -f " ${ BINARY } " ] ; then
2018-04-13 21:34:05 -04:00
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 "
2018-04-12 13:15:16 +02:00
exit 1
fi
2018-04-13 21:34:05 -04:00
BINARY_CHECK = " $( file " $BINARY " | grep 'ELF 64-bit LSB executable, x86-64' ) "
2018-04-12 13:15:16 +02:00
if [ -z " ${ BINARY_CHECK } " ] ; then
echo "Binary needs to be OS linux, ARCH amd64"
exit 1
fi
##
## Run binary with all parameters
##
export TMHOME = " /tendermint/node ${ ID } "
2018-04-24 16:40:51 -04:00
if [ -d " `dirname ${ TMHOME } / ${ LOG } ` " ] ; then
2018-04-13 21:34:05 -04:00
" $BINARY " " $@ " | tee " ${ TMHOME } / ${ LOG } "
2018-04-12 13:15:16 +02:00
else
2018-04-13 21:34:05 -04:00
" $BINARY " " $@ "
2018-04-12 13:15:16 +02:00
fi
2018-04-16 11:34:01 -04:00
chmod 777 -R /tendermint