mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-22 16:10:55 +02:00
do not resolve aliases, use as variables
This commit is contained in:
@@ -17,10 +17,6 @@ source /home/admin/raspiblitz.info 2>/dev/null
|
|||||||
source /mnt/hdd/raspiblitz.conf 2>/dev/null
|
source /mnt/hdd/raspiblitz.conf 2>/dev/null
|
||||||
|
|
||||||
source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
|
source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
|
||||||
shopt -s expand_aliases
|
|
||||||
alias bitcoincli_alias="$bitcoincli_alias"
|
|
||||||
alias lncli_alias="$lncli_alias"
|
|
||||||
alias lightningcli_alias="$lightningcli_alias"
|
|
||||||
|
|
||||||
## get HDD/SSD info
|
## get HDD/SSD info
|
||||||
source <(sudo /home/admin/config.scripts/blitz.datadrive.sh status)
|
source <(sudo /home/admin/config.scripts/blitz.datadrive.sh status)
|
||||||
@@ -282,7 +278,7 @@ if [ ${LNTYPE} = "cln" ]; then
|
|||||||
else
|
else
|
||||||
ln_sync=0
|
ln_sync=0
|
||||||
fi
|
fi
|
||||||
ln_version=$(lightningcli_alias -V)
|
ln_version=$($lightningcli_alias -V)
|
||||||
if [ ${ln_sync} -eq 0 ]; then
|
if [ ${ln_sync} -eq 0 ]; then
|
||||||
if [ ${#ln_getInfo} -eq 0 ]; then
|
if [ ${#ln_getInfo} -eq 0 ]; then
|
||||||
ln_baseInfo="${color_red} Not Started | Not Ready Yet"
|
ln_baseInfo="${color_red} Not Started | Not Ready Yet"
|
||||||
|
@@ -90,10 +90,6 @@ while :
|
|||||||
if [ ${configExists} -eq 1 ]; then
|
if [ ${configExists} -eq 1 ]; then
|
||||||
source ${configFile}
|
source ${configFile}
|
||||||
source <(/home/admin/config.scripts/network.aliases.sh getvars)
|
source <(/home/admin/config.scripts/network.aliases.sh getvars)
|
||||||
shopt -s expand_aliases
|
|
||||||
alias bitcoincli_alias="$bitcoincli_alias"
|
|
||||||
alias lncli_alias="$lncli_alias"
|
|
||||||
alias lightningcli_alias="$lightningcli_alias"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${setupPhase}" != "done" ]; then
|
if [ "${setupPhase}" != "done" ]; then
|
||||||
|
@@ -314,10 +314,6 @@ if [ "${state}" = "ready" ]; then
|
|||||||
echo "loading config data"
|
echo "loading config data"
|
||||||
source ${configFile}
|
source ${configFile}
|
||||||
source <(/home/admin/config.scripts/network.aliases.sh getvars lnd ${chain}net)
|
source <(/home/admin/config.scripts/network.aliases.sh getvars lnd ${chain}net)
|
||||||
shopt -s expand_aliases
|
|
||||||
alias bitcoincli_alias="$bitcoincli_alias"
|
|
||||||
alias lncli_alias="$lncli_alias"
|
|
||||||
alias lightningcli_alias="$lightningcli_alias"
|
|
||||||
else
|
else
|
||||||
echo "setup still in progress - setupStep(${setupStep})"
|
echo "setup still in progress - setupStep(${setupStep})"
|
||||||
fi
|
fi
|
||||||
@@ -344,7 +340,7 @@ waitUntilChainNetworkIsReady()
|
|||||||
echo "can take longer if device was off or first time"
|
echo "can take longer if device was off or first time"
|
||||||
|
|
||||||
# check for error on network
|
# check for error on network
|
||||||
bitcoincli_alias getblockchaininfo 1>/dev/null 2>error.tmp
|
$bitcoincli_alias getblockchaininfo 1>/dev/null 2>error.tmp
|
||||||
clienterror=$(cat error.tmp)
|
clienterror=$(cat error.tmp)
|
||||||
rm error.tmp
|
rm error.tmp
|
||||||
|
|
||||||
|
@@ -159,9 +159,7 @@ if [ "${chain}" != "${choice}" ]; then
|
|||||||
echo "C) For 'passphrase' to encrypt your 'cipher seed' use PASSWORD D (optional)"
|
echo "C) For 'passphrase' to encrypt your 'cipher seed' use PASSWORD D (optional)"
|
||||||
echo "****************************************************************************"
|
echo "****************************************************************************"
|
||||||
source <(/home/admin/config.scripts/network.aliases.sh getvars lnd ${choice}net)
|
source <(/home/admin/config.scripts/network.aliases.sh getvars lnd ${choice}net)
|
||||||
shopt -s expand_aliases
|
$lncli_alias create 2>error.out
|
||||||
alias lncli_alias="$lncli_alias"
|
|
||||||
lncli_alias create 2>error.out
|
|
||||||
error=$(sudo cat error.out)
|
error=$(sudo cat error.out)
|
||||||
if [ ${#error} -eq 0 ]; then
|
if [ ${#error} -eq 0 ]; then
|
||||||
sleep 2
|
sleep 2
|
||||||
|
@@ -51,9 +51,6 @@ lndRunning=$(systemctl status lnd.service 2>/dev/null | grep -c running)
|
|||||||
if [ ${lndRunning} -eq 1 ]; then
|
if [ ${lndRunning} -eq 1 ]; then
|
||||||
|
|
||||||
source <(/home/admin/config.scripts/network.aliases.sh getvars lnd)
|
source <(/home/admin/config.scripts/network.aliases.sh getvars lnd)
|
||||||
shopt -s expand_aliases
|
|
||||||
alias bitcoincli_alias="$bitcoincli_alias"
|
|
||||||
alias lncli_alias="$lncli_alias"
|
|
||||||
|
|
||||||
echo "LND is running ..."
|
echo "LND is running ..."
|
||||||
sleep 1
|
sleep 1
|
||||||
|
@@ -19,11 +19,9 @@ echo "HELP: Enter your PASSWORD C"
|
|||||||
echo "You may wait some seconds until you get asked for password."
|
echo "You may wait some seconds until you get asked for password."
|
||||||
echo "****************************************************************************"
|
echo "****************************************************************************"
|
||||||
source <(/home/admin/config.scripts/network.aliases.sh getvars lnd)
|
source <(/home/admin/config.scripts/network.aliases.sh getvars lnd)
|
||||||
shopt -s expand_aliases
|
|
||||||
alias lncli_alias="$lncli_alias"
|
|
||||||
while :
|
while :
|
||||||
do
|
do
|
||||||
lncli_alias --chain=${network} unlock
|
$lncli_alias --chain=${network} unlock
|
||||||
sleep 4
|
sleep 4
|
||||||
locked=$(sudo tail -n 1 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log 2>/dev/null | grep -c unlock)
|
locked=$(sudo tail -n 1 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log 2>/dev/null | grep -c unlock)
|
||||||
if [ ${locked} -eq 0 ]; then
|
if [ ${locked} -eq 0 ]; then
|
||||||
|
@@ -10,10 +10,6 @@ if [ ${#chain} -eq 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
|
source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
|
||||||
shopt -s expand_aliases
|
|
||||||
alias bitcoincli_alias="$bitcoincli_alias"
|
|
||||||
alias lncli_alias="$lncli_alias"
|
|
||||||
alias lightningcli_alias="$lightningcli_alias"
|
|
||||||
|
|
||||||
if [ $LNTYPE = cln ];then
|
if [ $LNTYPE = cln ];then
|
||||||
# https://lightning.readthedocs.io/lightning-close.7.html
|
# https://lightning.readthedocs.io/lightning-close.7.html
|
||||||
@@ -30,7 +26,7 @@ if [ $LNTYPE = cln ];then
|
|||||||
function cln_closeall {
|
function cln_closeall {
|
||||||
for i in $peerlist; do
|
for i in $peerlist; do
|
||||||
# close id [unilateraltimeout] [destination] [fee_negotiation_step] [*wrong_funding*]
|
# close id [unilateraltimeout] [destination] [fee_negotiation_step] [*wrong_funding*]
|
||||||
lightningcli_alias close $i 30
|
$lightningcli_alias close $i 30
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
elif [ $LNTYPE = lnd ];then
|
elif [ $LNTYPE = lnd ];then
|
||||||
|
@@ -13,10 +13,6 @@ if [ ${#chain} -eq 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
|
source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
|
||||||
shopt -s expand_aliases
|
|
||||||
alias bitcoincli_alias="$bitcoincli_alias"
|
|
||||||
alias lncli_alias="$lncli_alias"
|
|
||||||
alias lightningcli_alias="$lightningcli_alias"
|
|
||||||
|
|
||||||
# let user enter a <pubkey>@host
|
# let user enter a <pubkey>@host
|
||||||
l1="Enter the node pubkey address with host information:"
|
l1="Enter the node pubkey address with host information:"
|
||||||
|
@@ -15,10 +15,6 @@ if [ ${#chain} -eq 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
|
source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
|
||||||
shopt -s expand_aliases
|
|
||||||
alias bitcoincli_alias="$bitcoincli_alias"
|
|
||||||
alias lncli_alias="$lncli_alias"
|
|
||||||
alias lightningcli_alias="$lightningcli_alias"
|
|
||||||
|
|
||||||
# Check if ready (chain in sync and channels open)
|
# Check if ready (chain in sync and channels open)
|
||||||
./XXchainInSync.sh $network $chain $LNTYPE
|
./XXchainInSync.sh $network $chain $LNTYPE
|
||||||
|
@@ -12,10 +12,6 @@ if [ ${#chain} -eq 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
|
source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
|
||||||
shopt -s expand_aliases
|
|
||||||
alias bitcoincli_alias="$bitcoincli_alias"
|
|
||||||
alias lncli_alias="$lncli_alias"
|
|
||||||
alias lightningcli_alias="$lightningcli_alias"
|
|
||||||
|
|
||||||
# PRECHECK) check if chain is in sync
|
# PRECHECK) check if chain is in sync
|
||||||
if [ $LNTYPE = cln ];then
|
if [ $LNTYPE = cln ];then
|
||||||
|
@@ -13,10 +13,6 @@ if [ ${#chain} -eq 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
|
source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
|
||||||
shopt -s expand_aliases
|
|
||||||
alias bitcoincli_alias="$bitcoincli_alias"
|
|
||||||
alias lncli_alias="$lncli_alias"
|
|
||||||
alias lightningcli_alias="$lightningcli_alias"
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "# Precheck" # PRECHECK) check if chain is in sync
|
echo "# Precheck" # PRECHECK) check if chain is in sync
|
||||||
@@ -89,14 +85,14 @@ if [ $LNTYPE = cln ];then
|
|||||||
pubKey=$(echo ${grepLine} | cut -d '"' -f4)
|
pubKey=$(echo ${grepLine} | cut -d '"' -f4)
|
||||||
# echo "grepLine(${pubKey})"
|
# echo "grepLine(${pubKey})"
|
||||||
OPTIONS+=(${pubKey} "")
|
OPTIONS+=(${pubKey} "")
|
||||||
done < <(lightningcli_alias listpeers | grep '"id":')
|
done < <($lightningcli_alias listpeers | grep '"id":')
|
||||||
elif [ $LNTYPE = lnd ];then
|
elif [ $LNTYPE = lnd ];then
|
||||||
while IFS= read -r grepLine
|
while IFS= read -r grepLine
|
||||||
do
|
do
|
||||||
pubKey=$(echo ${grepLine} | cut -d '"' -f4)
|
pubKey=$(echo ${grepLine} | cut -d '"' -f4)
|
||||||
# echo "grepLine(${pubKey})"
|
# echo "grepLine(${pubKey})"
|
||||||
OPTIONS+=(${pubKey} "")
|
OPTIONS+=(${pubKey} "")
|
||||||
done < <(lncli_alias listpeers | grep pub_key)
|
done < <($lncli_alias listpeers | grep pub_key)
|
||||||
fi
|
fi
|
||||||
TITLE="Open (Payment) Channel"
|
TITLE="Open (Payment) Channel"
|
||||||
MENU="\nChoose a peer you connected to, to open the channel with: \n "
|
MENU="\nChoose a peer you connected to, to open the channel with: \n "
|
||||||
@@ -125,7 +121,7 @@ if [ "${network}" = "bitcoin" ]; then
|
|||||||
fi
|
fi
|
||||||
if [ $LNTYPE = lnd ];then
|
if [ $LNTYPE = lnd ];then
|
||||||
_error="./.error.out"
|
_error="./.error.out"
|
||||||
lncli_alias openchannel ${pubkey} 1 0 2>$_error
|
$lncli_alias openchannel ${pubkey} 1 0 2>$_error
|
||||||
error=$(cat ${_error})
|
error=$(cat ${_error})
|
||||||
if [ $(echo "${error}" | grep "channel is too small" -c) -eq 1 ]; then
|
if [ $(echo "${error}" | grep "channel is too small" -c) -eq 1 ]; then
|
||||||
minSat=$(echo "${error}" | tr -dc '0-9')
|
minSat=$(echo "${error}" | tr -dc '0-9')
|
||||||
@@ -165,9 +161,9 @@ fi
|
|||||||
if [ $LNTYPE = cln ];then
|
if [ $LNTYPE = cln ];then
|
||||||
# fundchannel id amount [feerate] [announce] [minconf] [utxos] [push_msat] [close_to]
|
# fundchannel id amount [feerate] [announce] [minconf] [utxos] [push_msat] [close_to]
|
||||||
feerate=$($bitcoincli_alias estimatesmartfee $conf_target |grep feerate|awk '{print $2}'|cut -c 5-7|bc)
|
feerate=$($bitcoincli_alias estimatesmartfee $conf_target |grep feerate|awk '{print $2}'|cut -c 5-7|bc)
|
||||||
command="lightningcli_alias fundchannel ${pubKey} ${amount} $feerate"
|
command="$lightningcli_alias fundchannel ${pubKey} ${amount} $feerate"
|
||||||
elif [ $LNTYPE = lnd ];then
|
elif [ $LNTYPE = lnd ];then
|
||||||
command="lncli_alias openchannel --conf_target=${conf_target} ${pubKey} ${amount} 0"
|
command="$lncli_alias openchannel --conf_target=${conf_target} ${pubKey} ${amount} 0"
|
||||||
fi
|
fi
|
||||||
# info output
|
# info output
|
||||||
clear
|
clear
|
||||||
|
@@ -15,10 +15,6 @@ if [ ${#chain} -eq 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
|
source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
|
||||||
shopt -s expand_aliases
|
|
||||||
alias bitcoincli_alias="$bitcoincli_alias"
|
|
||||||
alias lncli_alias="$lncli_alias"
|
|
||||||
alias lightningcli_alias="$lightningcli_alias"
|
|
||||||
|
|
||||||
# Check if ready (chain in sync and channels open)
|
# Check if ready (chain in sync and channels open)
|
||||||
./XXchainInSync.sh $network $chain $LNTYPE
|
./XXchainInSync.sh $network $chain $LNTYPE
|
||||||
|
@@ -15,14 +15,10 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
source <(/home/admin/config.scripts/network.aliases.sh getvars $LNTYPE ${chain}net)
|
source <(/home/admin/config.scripts/network.aliases.sh getvars $LNTYPE ${chain}net)
|
||||||
shopt -s expand_aliases
|
|
||||||
alias bitcoincli_alias="$bitcoincli_alias"
|
|
||||||
alias lncli_alias="$lncli_alias"
|
|
||||||
alias lightningcli_alias="$lightningcli_alias"
|
|
||||||
|
|
||||||
# check if chain is in sync
|
# check if chain is in sync
|
||||||
if [ $LNTYPE = cln ];then
|
if [ $LNTYPE = cln ];then
|
||||||
lncommand="lightning-cli"
|
lncommand="${netprefix}lightning-cli"
|
||||||
BLOCKHEIGHT=$($bitcoincli_alias getblockchaininfo|grep blocks|awk '{print $2}'|cut -d, -f1)
|
BLOCKHEIGHT=$($bitcoincli_alias getblockchaininfo|grep blocks|awk '{print $2}'|cut -d, -f1)
|
||||||
CLHEIGHT=$($lightningcli_alias getinfo | jq .blockheight)
|
CLHEIGHT=$($lightningcli_alias getinfo | jq .blockheight)
|
||||||
if [ $BLOCKHEIGHT -eq $CLHEIGHT ];then
|
if [ $BLOCKHEIGHT -eq $CLHEIGHT ];then
|
||||||
@@ -31,8 +27,8 @@ if [ $LNTYPE = cln ];then
|
|||||||
cmdChainInSync=0
|
cmdChainInSync=0
|
||||||
fi
|
fi
|
||||||
elif [ $LNTYPE = lnd ];then
|
elif [ $LNTYPE = lnd ];then
|
||||||
lncommand="lncli"
|
lncommand="${netprefix}lncli"
|
||||||
cmdChainInSync="lncli_alias getinfo | grep '"synced_to_chain": true' -c"
|
cmdChainInSync="$lncli_alias getinfo | grep '"synced_to_chain": true' -c"
|
||||||
fi
|
fi
|
||||||
chainInSync=${cmdChainInSync}
|
chainInSync=${cmdChainInSync}
|
||||||
while [ "${chainInSync}" == "0" ]; do
|
while [ "${chainInSync}" == "0" ]; do
|
||||||
|
@@ -11,10 +11,6 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
source <(/home/admin/config.scripts/network.aliases.sh getvars $LNTYPE ${chain}net)
|
source <(/home/admin/config.scripts/network.aliases.sh getvars $LNTYPE ${chain}net)
|
||||||
shopt -s expand_aliases
|
|
||||||
alias bitcoincli_alias="$bitcoincli_alias"
|
|
||||||
alias lncli_alias="$lncli_alias"
|
|
||||||
alias lightningcli_alias="$lightningcli_alias"
|
|
||||||
|
|
||||||
# command info
|
# command info
|
||||||
if [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
if [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||||
@@ -58,7 +54,7 @@ echo "bitcoinActive=${bitcoinRunning}"
|
|||||||
if [ ${bitcoinRunning} -eq 1 ]; then
|
if [ ${bitcoinRunning} -eq 1 ]; then
|
||||||
|
|
||||||
# get blockchain info
|
# get blockchain info
|
||||||
bitcoincli_alias getblockchaininfo 1>/mnt/hdd/temp/.bitcoind.out 2>/mnt/hdd/temp/.bitcoind.error
|
$bitcoincli_alias getblockchaininfo 1>/mnt/hdd/temp/.bitcoind.out 2>/mnt/hdd/temp/.bitcoind.error
|
||||||
# check if error on request
|
# check if error on request
|
||||||
blockchaininfo=$(cat /mnt/hdd/temp/.bitcoind.out 2>/dev/null)
|
blockchaininfo=$(cat /mnt/hdd/temp/.bitcoind.out 2>/dev/null)
|
||||||
bitcoinError=$(cat /mnt/hdd/temp/.bitcoind.error 2>/dev/null)
|
bitcoinError=$(cat /mnt/hdd/temp/.bitcoind.error 2>/dev/null)
|
||||||
|
@@ -19,10 +19,6 @@ fi
|
|||||||
if [ $1 = on ];then
|
if [ $1 = on ];then
|
||||||
|
|
||||||
source <(/home/admin/config.scripts/network.aliases.sh getvars cln $2)
|
source <(/home/admin/config.scripts/network.aliases.sh getvars cln $2)
|
||||||
shopt -s expand_aliases
|
|
||||||
alias bitcoincli_alias="$bitcoincli_alias"
|
|
||||||
alias lncli_alias="$lncli_alias"
|
|
||||||
alias lightningcli_alias="$lightningcli_alias"
|
|
||||||
|
|
||||||
plugin=$2
|
plugin=$2
|
||||||
|
|
||||||
@@ -31,15 +27,15 @@ if [ $1 = on ];then
|
|||||||
sudo -u bitcoin git clone https://github.com/lightningd/plugins.git
|
sudo -u bitcoin git clone https://github.com/lightningd/plugins.git
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $(lightningcli_alias | grep -c "${plugin}") -eq 0 ];then
|
if [ $($lightningcli_alias | grep -c "${plugin}") -eq 0 ];then
|
||||||
echo "# Starting the ${plugin} plugin"
|
echo "# Starting the ${plugin} plugin"
|
||||||
sudo -u bitcoin pip install -r /home/bitcoin/cln-plugins-available/plugins/${plugin}/requirements.txt
|
sudo -u bitcoin pip install -r /home/bitcoin/cln-plugins-available/plugins/${plugin}/requirements.txt
|
||||||
lightningcli_alias plugin start /home/bitcoin/cln-plugins-available/plugins/${plugin}/${plugin}.py
|
$lightningcli_alias plugin start /home/bitcoin/cln-plugins-available/plugins/${plugin}/${plugin}.py
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Node URI:"
|
echo "Node URI:"
|
||||||
ln_getinfo=$(lightningcli_alias -H getinfo 2>/dev/null)
|
ln_getinfo=$($lightningcli_alias -H getinfo 2>/dev/null)
|
||||||
pubkey=$(echo "$ln_getinfo" | grep "id=" | cut -d= -f2)
|
pubkey=$(echo "$ln_getinfo" | grep "id=" | cut -d= -f2)
|
||||||
toraddress=$(echo "$ln_getinfo" | grep ".onion" | cut -d= -f2)
|
toraddress=$(echo "$ln_getinfo" | grep ".onion" | cut -d= -f2)
|
||||||
port=$(echo "$ln_getinfo" | grep "port" | tail -n1 | cut -d= -f2)
|
port=$(echo "$ln_getinfo" | grep "port" | tail -n1 | cut -d= -f2)
|
||||||
@@ -48,11 +44,11 @@ if [ $1 = on ];then
|
|||||||
echo "# Running:"
|
echo "# Running:"
|
||||||
echo "${netprefix}lightning-cli ${plugin}"
|
echo "${netprefix}lightning-cli ${plugin}"
|
||||||
echo
|
echo
|
||||||
lightningcli_alias ${plugin}
|
$lightningcli_alias ${plugin}
|
||||||
echo
|
echo
|
||||||
|
|
||||||
if [ "$(echo "$@" | grep -c "runonce")" -gt 0 ];then
|
if [ "$(echo "$@" | grep -c "runonce")" -gt 0 ];then
|
||||||
lightningcli_alias plugin stop /home/bitcoin/cln-plugins-available/plugins/${plugin}/${plugin}.py
|
$lightningcli_alias plugin stop /home/bitcoin/cln-plugins-available/plugins/${plugin}/${plugin}.py
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
@@ -27,7 +27,7 @@ fi
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Node URI:"
|
echo "Node URI:"
|
||||||
ln_getinfo=$(lightningcli_alias -H getinfo 2>/dev/null)
|
ln_getinfo=$($lightningcli_alias -H getinfo 2>/dev/null)
|
||||||
pubkey=$(echo "$ln_getinfo" | grep "id=" | cut -d= -f2)
|
pubkey=$(echo "$ln_getinfo" | grep "id=" | cut -d= -f2)
|
||||||
toraddress=$(echo "$ln_getinfo" | grep ".onion" | cut -d= -f2)
|
toraddress=$(echo "$ln_getinfo" | grep ".onion" | cut -d= -f2)
|
||||||
port=$(echo "$ln_getinfo" | grep "port" | tail -n1 | cut -d= -f2)
|
port=$(echo "$ln_getinfo" | grep "port" | tail -n1 | cut -d= -f2)
|
||||||
|
@@ -11,10 +11,6 @@ source /home/admin/raspiblitz.info
|
|||||||
source /mnt/hdd/raspiblitz.conf
|
source /mnt/hdd/raspiblitz.conf
|
||||||
|
|
||||||
source <(/home/admin/config.scripts/network.aliases.sh getvars lnd ${chain}net)
|
source <(/home/admin/config.scripts/network.aliases.sh getvars lnd ${chain}net)
|
||||||
shopt -s expand_aliases
|
|
||||||
alias bitcoincli_alias="$bitcoincli_alias"
|
|
||||||
alias lncli_alias="$lncli_alias"
|
|
||||||
alias lightningcli_alias="$lightningcli_alias"
|
|
||||||
|
|
||||||
# 1. parameter
|
# 1. parameter
|
||||||
passwordC="$1"
|
passwordC="$1"
|
||||||
@@ -128,7 +124,7 @@ do
|
|||||||
echo "############################"
|
echo "############################"
|
||||||
echo "Calling: ${netprefix}lncli unlock"
|
echo "Calling: ${netprefix}lncli unlock"
|
||||||
echo "Please re-enter Password C:"
|
echo "Please re-enter Password C:"
|
||||||
lncli_alias unlock --recovery_window=1000
|
$lncli_alias unlock --recovery_window=1000
|
||||||
|
|
||||||
# test unlock
|
# test unlock
|
||||||
walletLocked=$($lncli_alias getinfo 2>&1 | grep -c unlock)
|
walletLocked=$($lncli_alias getinfo 2>&1 | grep -c unlock)
|
||||||
|
@@ -3,11 +3,6 @@
|
|||||||
# Usage:
|
# Usage:
|
||||||
# source <(/home/admin/config.scripts/network.aliases.sh getvars <lnd|cln> <mainnet|testnet|signet>)
|
# source <(/home/admin/config.scripts/network.aliases.sh getvars <lnd|cln> <mainnet|testnet|signet>)
|
||||||
|
|
||||||
# To have aliases resolved inside a script:
|
|
||||||
# shopt -s expand_aliases
|
|
||||||
# alias bitcoincli_alias="$bitcoincli_alias"
|
|
||||||
# alias lncli_alias="$lncli_alias"
|
|
||||||
# alias lightningcli_alias="$lightningcli_alias"
|
|
||||||
source /home/admin/raspiblitz.info
|
source /home/admin/raspiblitz.info
|
||||||
source /mnt/hdd/raspiblitz.conf
|
source /mnt/hdd/raspiblitz.conf
|
||||||
|
|
||||||
|
@@ -13,10 +13,6 @@ source /home/admin/raspiblitz.info
|
|||||||
source /mnt/hdd/raspiblitz.conf
|
source /mnt/hdd/raspiblitz.conf
|
||||||
|
|
||||||
source <(/home/admin/config.scripts/network.aliases.sh getvars lnd ${chain}net)
|
source <(/home/admin/config.scripts/network.aliases.sh getvars lnd ${chain}net)
|
||||||
shopt -s expand_aliases
|
|
||||||
alias bitcoincli_alias="$bitcoincli_alias"
|
|
||||||
alias lncli_alias="$lncli_alias"
|
|
||||||
alias lightningcli_alias="$lightningcli_alias"
|
|
||||||
|
|
||||||
###################
|
###################
|
||||||
# STATUS
|
# STATUS
|
||||||
@@ -117,7 +113,7 @@ if [ "$1" = "peer-kickstart" ]; then
|
|||||||
echo "newpeer='${nodeAddress}"
|
echo "newpeer='${nodeAddress}"
|
||||||
|
|
||||||
# kick start node with
|
# kick start node with
|
||||||
bitcoincli_alias addnode "${nodeAddress}" "onetry" 1>/dev/null
|
$bitcoincli_alias addnode "${nodeAddress}" "onetry" 1>/dev/null
|
||||||
echo "exitcode=$?"
|
echo "exitcode=$?"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
@@ -137,15 +133,15 @@ if [ "$1" = "peer-disconnectall" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# get all peer id and disconnect them
|
# get all peer id and disconnect them
|
||||||
bitcoincli_alias getpeerinfo | grep '"addr": "' | while read line
|
$bitcoincli_alias getpeerinfo | grep '"addr": "' | while read line
|
||||||
do
|
do
|
||||||
peerID=$(echo $line | cut -d '"' -f4)
|
peerID=$(echo $line | cut -d '"' -f4)
|
||||||
echo "# disconnecting peer with ID: ${peerID}"
|
echo "# disconnecting peer with ID: ${peerID}"
|
||||||
bitcoincli_alias disconnectnode ${peerID}
|
$bitcoincli_alias disconnectnode ${peerID}
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "#### FINAL PEER INFO FROM BITCOIND"
|
echo "#### FINAL PEER INFO FROM BITCOIND"
|
||||||
bitcoincli_alias getpeerinfo
|
$bitcoincli_alias getpeerinfo
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user