rename ageth to ageth-{{ geth_cont_name }}

This fixes issue on hosts where multiple instances run.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2020-01-29 13:10:41 +01:00
parent 2529f70a94
commit 91e1da9e03
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
2 changed files with 7 additions and 3 deletions

View File

@ -2,5 +2,5 @@
- name: Create geth attach wrapper
template:
src: geth-attach-wrapper.sh
dest: /usr/local/bin/ageth
dest: '/usr/local/bin/ageth-{{ geth_cont_name }}'
mode: 0755

View File

@ -1,6 +1,10 @@
#!/usr/bin/env bash
GETH_RPC_PORT="{{ geth_rpc_port }}"
GETH_CONT_NAME="{{ geth_cont_name }}"
if [[ -z "$@" ]]; then
docker exec -it {{ geth_cont_name }} geth attach http://localhost:{{ geth_rpc_port }}
docker exec -it "${GETH_CONT_NAME}" geth attach "http://localhost:${GETH_RPC_PORT}"
else
docker exec {{ geth_cont_name }} geth attach http://localhost:{{ geth_rpc_port }} --exec "$@"
docker exec "${GETH_CONT_NAME}" geth attach "http://localhost:${GETH_RPC_PORT}" --exec "$@"
fi