infra-role-geth/templates/attach.sh.j2
Jakub Sokołowski f8f2e33772
attach.sh: fix position of --exec argument
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2022-12-09 13:05:36 +01:00

13 lines
384 B
Django/Jinja

#!/usr/bin/env bash
# vim: set ft=sh:
GETH_CONT_NAME="{{ geth_cont_name }}"
GETH_RPC_PORT="{{ geth_rpc_port }}"
GETH_RPC_ADDR="localhost"
GETH_RPC_URL="http://${GETH_RPC_ADDR}:${GETH_RPC_PORT}"
if [[ -z "$@" ]]; then
exec docker exec -it "${GETH_CONT_NAME}" geth attach "${GETH_RPC_URL}"
else
exec docker exec "${GETH_CONT_NAME}" geth attach --exec "$@" "${GETH_RPC_URL}"
fi