mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-04-11 05:09:40 +02:00
always (re)init cln backup plugin
This commit is contained in:
parent
02ca76490a
commit
332e47c84a
@ -9,7 +9,6 @@ function help(){
|
||||
echo "cln-plugin.backup.sh [on|off] [testnet|mainnet|signet]"
|
||||
echo "cln-plugin.backup.sh [restore] [testnet|mainnet|signet] [force]"
|
||||
echo "cln-plugin.backup.sh [backup-compact] [testnet|mainnet|signet]"
|
||||
echo "cln-plugin.backup.sh [check [testnet|mainnet|signet]"
|
||||
echo
|
||||
echo "https://github.com/lightningd/plugins/tree/master/backup"
|
||||
echo
|
||||
@ -65,14 +64,15 @@ if [ $1 = on ];then
|
||||
/home/bitcoin/${netprefix}lightningd.sqlite3.backup.${now} || exit 1
|
||||
fi
|
||||
|
||||
# init plugin
|
||||
if ! sudo ls /home/bitcoin/.lightning/${CLNETWORK}/backup.lock; then
|
||||
# https://github.com/lightningd/plugins/tree/master/backup#setup
|
||||
echo "# Initialize the backup plugin"
|
||||
sudo -u bitcoin ${plugindir}/backup/backup-cli init\
|
||||
--lightning-dir /home/bitcoin/.lightning/${CLNETWORK} \
|
||||
file:///home/bitcoin/${netprefix}lightningd.sqlite3.backup
|
||||
# always re-init plugin
|
||||
if sudo ls /home/bitcoin/.lightning/${CLNETWORK}/backup.lock; then
|
||||
sudo rm /home/bitcoin/.lightning/${CLNETWORK}/backup.lock
|
||||
fi
|
||||
# https://github.com/lightningd/plugins/tree/master/backup#setup
|
||||
echo "# Initialize the backup plugin"
|
||||
sudo -u bitcoin ${plugindir}/backup/backup-cli init\
|
||||
--lightning-dir /home/bitcoin/.lightning/${CLNETWORK} \
|
||||
file:///home/bitcoin/${netprefix}lightningd.sqlite3.backup
|
||||
|
||||
source /home/admin/raspiblitz.info
|
||||
if [ "${state}" == "ready" ]; then
|
||||
@ -80,9 +80,6 @@ if [ $1 = on ];then
|
||||
echo "# Started the ${netprefix}lightningd.service"
|
||||
fi
|
||||
|
||||
elif [ $1 = check ];then
|
||||
|
||||
|
||||
|
||||
elif [ $1 = off ];then
|
||||
echo "# Removing the backup plugin"
|
||||
@ -94,6 +91,7 @@ elif [ $1 = off ];then
|
||||
echo "# Removing the backup.lock file"
|
||||
sudo rm -f /home/bitcoin/.lightning/${CLNETWORK}/backup.lock
|
||||
|
||||
|
||||
elif [ $1 = restore ];then
|
||||
|
||||
install
|
||||
@ -121,10 +119,15 @@ elif [ $1 = restore ];then
|
||||
sudo -u bitcoin ${plugindir}/backup/backup-cli restore \
|
||||
file:///home/bitcoin/${netprefix}lightningd.sqlite3.backup \
|
||||
/home/bitcoin/.lightning/${CLNETWORK}/lightningd.sqlite3
|
||||
|
||||
sudo systemctl start ${netprefix}lightningd
|
||||
|
||||
source /home/admin/raspiblitz.info
|
||||
if [ "${state}" == "ready" ]; then
|
||||
sudo systemctl start ${netprefix}lightningd
|
||||
echo "# Started the ${netprefix}lightningd.service"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
elif [ $1 = backup-compact ];then
|
||||
|
||||
if sudo ls /home/bitcoin/.lightning/${CLNETWORK}/lightningd.sqlite3;then
|
||||
|
@ -296,6 +296,9 @@ if [ ${mode} = "cln-import-gui" ]; then
|
||||
echo "# Starting cln.hsmtool.sh unlock"
|
||||
/home/admin/config.scripts/cln.hsmtool.sh unlock # there are mutiple wallets possible, need to check for non-default ones too
|
||||
fi
|
||||
|
||||
# init backup plugin
|
||||
/home/admin/config.scripts/cln-plugin.backup.sh on $CHAIN
|
||||
|
||||
# restarting cln & give final info
|
||||
sudo systemctl start lightningd
|
||||
|
Loading…
x
Reference in New Issue
Block a user