Browse Source

updated script to lnd0.52

dev
rootzoll 6 years ago
parent
commit
62e0bf7587
  1. 13
      home.admin/BBpayInvoice.sh

13
home.admin/BBpayInvoice.sh

@ -14,6 +14,7 @@ fi
echo "" echo ""
echo "*** Precheck ***" echo "*** Precheck ***"
echo "please wait a moment ..."
# check if chain is in sync # check if chain is in sync
chainInSync=$(lncli --chain=${network} --network=${chain}net getinfo | grep '"synced_to_chain": true' -c) chainInSync=$(lncli --chain=${network} --network=${chain}net getinfo | grep '"synced_to_chain": true' -c)
@ -81,9 +82,11 @@ command="lncli --chain=${network} --network=${chain}net sendpayment --force --pa
# info output # info output
clear clear
echo "******************************" echo "************************************************************"
echo "Pay Invoice / Payment Request" echo "Pay Invoice / Payment Request"
echo "******************************" echo "This script is as an example how to use the lncli interface."
echo "Its not optimized for performance or error handling."
echo "************************************************************"
echo "" echo ""
echo "COMMAND LINE: " echo "COMMAND LINE: "
echo $command echo $command
@ -97,9 +100,15 @@ error=`cat ${_error}`
#echo "result(${result})" #echo "result(${result})"
#echo "error(${error})" #echo "error(${error})"
resultIsError=$(echo "${result}" | grep -c "payment_error")
if [ ${resultIsError} -gt 0 ]; then
error="${result}"
fi
if [ ${#error} -gt 0 ]; then if [ ${#error} -gt 0 ]; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "FAIL" echo "FAIL"
echo "try with a wallet app or the RTL WebGUI (see services)"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "${error}" echo "${error}"
else else

Loading…
Cancel
Save