Skip to content

Commit

Permalink
Added layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoît Clouet authored and Benoît Clouet committed Jul 10, 2017
1 parent 90591ea commit 72b842c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions facts.d/geth-getconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@

# Ethereum seems not to be properly installed
if [ ! -f /lib/systemd/system/geth.service ]; then
# Nothing to return
echo -e "{}"
exit 0
fi

ETH_PID=$(pidof eth)
ETH_PID=$(pidof geth)

# Ethereum seems not to be running
if [ -z $ETH_PID ]; then
echo -e "{}"
# Return empty information
echo -e "go-ethereum: {}"
exit 0
fi
DATADIR=$(grep datadir /lib/systemd/system/geth.service |cut --delimiter '"' --fields 2)
Expand All @@ -19,4 +21,4 @@ IPC="ipc:$(find $DATADIR -name geth.ipc)"
NODE_INFO=$(geth --exec "admin.nodeInfo" attach $IPC)
ETH=$(geth --exec "eth" attach $IPC)

echo -e "{\n ethPid: $ETH_PID,\n nodeInfo: $NODE_INFO,\n eth: $ETH\n}"
echo -e "go-ethereum: {\n gethPid: $ETH_PID,\n nodeInfo: $NODE_INFO,\n eth: $ETH\n}"

0 comments on commit 72b842c

Please sign in to comment.