nix-bitcoin/pkgs/nodeinfo.sh

16 lines
341 B
Bash
Raw Normal View History

set -e
set -o pipefail
2018-11-20 14:14:40 -08:00
OUTFILE=/var/lib/nodeinfo.nix
BITCOIND_ONION=$(cat /var/lib/tor/onion/bitcoind/hostname)
CLIGHTNING_ID=$(sudo -u clightning lightning-cli getinfo | jq -r '.id')
2018-11-20 14:14:40 -08:00
rm -f $OUTFILE
{
echo \{
echo " bitcoind_onion = \"$BITCOIND_ONION\";"
echo " clightning_id = \"$CLIGHTNING_ID\";"
2018-11-20 14:14:40 -08:00
echo \}
} > $OUTFILE