Skip to content

Commit

Permalink
include mail password when getting enode with get_enode.sh
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Sokołowski <[email protected]>
  • Loading branch information
jakubgs committed Feb 5, 2020
1 parent f2eebd1 commit b476d5c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions _assets/scripts/get_enode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ RPC_PORT="${RPC_PORT:-8545}"
if [[ -z "${PUBLIC_IP}" ]]; then
PUBLIC_IP=$(curl -s https://ipecho.net/plain)
fi
# Necessary for enode address for Status app
MAIL_PASSWORD="${MAIL_PASSWORD:-status-offline-inbox}"

# query local
RESP_JSON=$(
Expand All @@ -23,5 +25,7 @@ ENODE_RAW=$(echo "${RESP_JSON}" | jq -r '.result.enode')
# drop arguments at the end of enode address
ENODE_CLEAN=$(echo "${ENODE_RAW}" | grep -oP '\Kenode://[^?]+')

# replace localhost with public IP
echo "${ENODE_CLEAN}" | sed s/127.0.0.1/${PUBLIC_IP}/
# replace localhost with public IP and add mail password
echo "${ENODE_CLEAN}" | sed \
-e "s/127.0.0.1/${PUBLIC_IP}/" \
-e "s/@/:${MAIL_PASSWORD}@/"

0 comments on commit b476d5c

Please sign in to comment.