#2925 encrypt and lock cl wallet before backup

This commit is contained in:
openoms 2022-02-09 11:48:25 +00:00
parent f845592b10
commit 4c4aef9fcc
No known key found for this signature in database
GPG Key ID: 5BFB77609B081B65
3 changed files with 16 additions and 3 deletions

View File

@ -106,6 +106,13 @@ case $CHOICE in
read key
;;
MIGRATION)
if [ "${cl}" == "on" ] || [ "${cl}" == "1" ] && [ "${clEncryptedHSM}" != "on" ] ; then
dialog \
--title "Encrypt the C-lightning wallet" \
--infobox "\nWill proceed to encrypt and lock the C-lightning wallet to prevent it from starting automatically after the backup" 7 55
sudo /home/admin/config.scripts/cl.hsmtool.sh encrypt mainnet
/home/admin/config.scripts/cl.hsmtool.sh lock mainnet
fi
sudo /home/admin/config.scripts/blitz.migration.sh "export-gui"
echo "Press ENTER to return to main menu."
read key

View File

@ -90,8 +90,14 @@ case $CHOICE in
;;
BACKUP)
if [ "${cl}" == "on" ] || [ "${cl}" == "1" ] && [ "${clEncryptedHSM}" != "on" ] ; then
dialog \
--title "Encrypt the C-lightning wallet" \
--infobox "\nWill proceed to encrypt and lock the C-lightning wallet to prevent it from starting automatically after the backup" 7 55
sudo /home/admin/config.scripts/cl.hsmtool.sh encrypt mainnet
/home/admin/config.scripts/cl.hsmtool.sh lock mainnet
fi
## from dialogLightningWallet.sh
# run upload dialog and get result
_temp="/var/cache/raspiblitz/temp/.temp.tmp"
clear
/home/admin/config.scripts/cl.backup.sh cl-export-gui production $_temp

View File

@ -333,7 +333,7 @@ if [ ${mode} = "cl-import-gui" ]; then
done
# in setup scenario the final import is happening during provison
# in setup scenario the final import is happening during provision
if [ "${scenario}" == "setup" ]; then
# just add clrescue filename to give file
echo "# result in: ${RESULTFILE} (remember to make clean delete once processed)"
@ -381,7 +381,7 @@ if [ ${mode} = "cl-import-gui" ]; then
else
cat $output
echo "# Starting cl.hsmtool.sh unlock"
/home/admin/config.scripts/cl.hsmtool.sh unlock # there are mutiple wallets possible, need to check for non-default ones too
/home/admin/config.scripts/cl.hsmtool.sh unlock $CHAIN
fi
# set the lightningd service file on each active network