Browse Source

LND check RPC password

master
Christian Rotzoll 6 years ago
parent
commit
29720377b6
  1. 2
      home.admin/70initLND.sh
  2. 16
      home.admin/config.scripts/lnd.check.sh

2
home.admin/70initLND.sh

@ -93,6 +93,8 @@ echo ""
echo "*** Starting LND ***"
lndRunning=$(sudo systemctl status lnd.service 2>/dev/null | grep -c running)
if [ ${lndRunning} -eq 0 ]; then
sudo systemctl stop lnd 2>/dev/null
sudo systemctl disable lnd 2>/dev/null
sed -i "5s/.*/Wants=${network}d.service/" /home/admin/assets/lnd.service
sed -i "6s/.*/After=${network}d.service/" /home/admin/assets/lnd.service
sudo cp /home/admin/assets/lnd.service /etc/systemd/system/lnd.service

16
home.admin/config.scripts/lnd.check.sh

@ -141,6 +141,22 @@ if [ "$1" == "basic-setup" ]; then
echo "wallet=0"
fi
# check that RPC password between Bitcoin and LND is correct
rpcpasscorrect=0
source <(sudo cat /mnt/hdd/lnd/lnd.conf 2>/dev/null | grep "${lndNetwork}d.rpcpass" | sed 's/^[a-z]*\./lnd/g')
source <(sudo cat /mnt/hdd/${lndNetwork}/${lndNetwork}.conf 2>/dev/null | grep "rpcpassword" | sed 's/^[a-z]*\./lnd/g')
if [ ${#lndrpcpass} -eq 0 ]; then
echo "err='lnd.conf: missing ${lndNetwork}d.rpcpass (needs to be same as set in ${lndNetwork}.conf)'"
elif [ ${#rpcpassword} -eq 0 ]; then
echo "err='${lndNetwork}.conf: missing rpcpassword (needs to be same as set in lnd.conf)'"
elif [ "${rpcpassword}" != "${lndrpcpass}" ]; then
echo "err='${lndNetwork}.conf (${rpcpassword}) & lnd.conf (${lndrpcpass}): RPC password missmatch! - LND cannot connect to blockchain RPC'"
else
# OK looks good
rpcpasscorrect=1
fi
echo "rpcpasscorrect='${rpcpasscorrect}'"
else
echo "# FAIL: parameter not known"
fi
Loading…
Cancel
Save