infra-role-geth/templates/attach.sh.j2

13 lines
357 B
Django/Jinja

#!/usr/bin/env bash
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
docker exec -it "${GETH_CONT_NAME}" geth attach "${GETH_RPC_URL}"
else
docker exec "${GETH_CONT_NAME}" geth attach "${GETH_RPC_URL}" --exec "$@"
fi