2020-04-26 15:39:10 +02:00
#!/bin/bash
2022-12-09 21:49:44 +01:00
2020-04-26 15:39:10 +02:00
# load raspiblitz config data
source /home/admin/_version.info
2021-06-24 22:48:11 +02:00
source /home/admin/raspiblitz.info
source /mnt/hdd/raspiblitz.conf 2>/dev/null
2020-04-26 15:39:10 +02:00
2020-09-16 13:33:14 +02:00
## PROCEDURES
2020-04-26 15:39:10 +02:00
release( )
{
whiptail --title "Update Instructions" --yes-button "Not Now" --no-button "Start Update" --yesno " To update your RaspiBlitz to a new version:
- Download the new SD card image to your laptop:
https://github.com/rootzoll/raspiblitz
2020-10-30 12:23:32 +01:00
- Flash that SD card image to a new SD card ( best)
2021-12-14 23:34:35 +01:00
or override old SD card after shutdown ( fallback)
2020-04-26 15:39:10 +02:00
- Choose 'Start Update' below.
No need to close channels or download blockchain again.
Do you want to start the Update now?
" 16 62
if [ $? -eq 0 ] ; then
2021-08-03 16:15:32 +02:00
exit 0
2020-04-26 15:39:10 +02:00
fi
2021-08-03 23:09:45 +02:00
if [ " ${ lightning } " != "" ] ; then
whiptail --title "Lightning Data Backup" --yes-button "Download Backup" --no-button "Skip" --yesno "
2020-04-26 15:39:10 +02:00
Before we start the RaspiBlitz Update process,
2021-08-03 23:09:45 +02:00
its recommended to make a backup of all your Lightning
Channel Data and download that file to your laptop.
2020-04-26 15:39:10 +02:00
2021-08-03 23:09:45 +02:00
Do you want to download Lightning Data Backup now?
2022-01-16 13:51:18 +01:00
" 12 62
2021-08-03 23:09:45 +02:00
if [ $? -eq 0 ] ; then
2021-12-19 17:56:38 +01:00
if [ " ${ lightning } " = = "lnd" ] || [ " ${ lnd } " = "on" ] ; then
2021-12-19 19:35:27 +01:00
clear
echo "***********************************"
echo "* PREPARING THE LND BACKUP DOWNLOAD"
echo "***********************************"
echo "please wait .."
2021-12-07 12:13:03 +01:00
/home/admin/config.scripts/lnd.compact.sh interactive
2021-08-03 23:09:45 +02:00
/home/admin/config.scripts/lnd.backup.sh lnd-export-gui
2021-12-19 19:35:27 +01:00
echo
echo "PRESS ENTER to continue once you're done downloading."
read key
2021-12-19 17:56:38 +01:00
fi
if [ " ${ lightning } " = = "cl" ] || [ " ${ cl } " = "on" ] ; then
2021-12-19 19:35:27 +01:00
clear
echo "*******************************************"
2022-07-27 08:29:16 +02:00
echo "* PREPARING THE CORE LIGHTNING BACKUP DOWNLOAD"
2021-12-19 19:35:27 +01:00
echo "*******************************************"
echo "please wait .."
2021-09-26 11:30:09 +02:00
/home/admin/config.scripts/cl.backup.sh cl-export-gui
2021-12-19 19:35:27 +01:00
echo
echo "PRESS ENTER to continue once you're done downloading."
read key
2021-08-03 23:09:45 +02:00
fi
else
clear
2021-12-19 19:35:27 +01:00
echo "*****************************************"
echo "* JUST MAKING A BACKUP TO THE OLD SD CARD"
echo "*****************************************"
2021-08-03 23:09:45 +02:00
echo "please wait .."
sleep 2
2021-12-19 17:56:38 +01:00
if [ " ${ lightning } " = = "lnd" ] || [ " ${ lnd } " = "on" ] ; then
2021-08-03 23:09:45 +02:00
/home/admin/config.scripts/lnd.backup.sh lnd-export
2021-12-19 17:56:38 +01:00
fi
if [ " ${ lightning } " = = "cl" ] || [ " ${ cl } " = "on" ] ; then
2021-09-26 11:30:09 +02:00
/home/admin/config.scripts/cl.backup.sh cl-export
2021-08-03 23:09:45 +02:00
fi
2021-12-19 17:56:38 +01:00
sleep 3
2021-08-03 23:09:45 +02:00
fi
2020-04-26 15:39:10 +02:00
fi
whiptail --title "READY TO UPDATE?" --yes-button "START UPDATE" --no-button "Cancel" --yesno " If you start the update: The RaspiBlitz will power down.
2021-08-27 09:59:21 +02:00
Once the LCD is white and no LEDs are blinking anymore:
2020-04-26 15:39:10 +02:00
- Remove the Power from RaspiBlitz
- Exchange the old with the new SD card
- Connect Power back to the RaspiBlitz
2024-06-10 16:40:39 +02:00
- Login again per SSH or WebUI
2020-04-26 15:39:10 +02:00
Do you have the SD card with the new version image ready
and do you WANT TO START UPDATE NOW?
" 16 62
if [ $? -eq 1 ] ; then
dialog --title " Update Canceled " --msgbox "
OK. RaspiBlitz will NOT update now.
" 7 39
2021-08-03 23:09:45 +02:00
sudo systemctl start lnd 2>/dev/null
sudo systemctl start lightningd 2>/dev/null
2021-08-03 16:15:32 +02:00
exit 0
2020-04-26 15:39:10 +02:00
fi
clear
sudo shutdown now
}
2020-04-26 17:56:32 +02:00
patchNotice( )
2020-04-26 15:39:10 +02:00
{
2020-04-26 23:22:33 +02:00
whiptail --title "Patching Notice" --yes-button "Dont Patch" --no-button "Patch Menu" --yesno " This is the possibility to patch your RaspiBlitz:
2020-04-26 15:39:10 +02:00
It means it will sync the program code with the
2020-09-21 16:53:11 +02:00
GitHub repo for your version branch v${ codeVersion } .
2020-04-26 15:39:10 +02:00
2021-12-14 23:34:35 +01:00
This can be useful if there are important updates
2020-12-10 19:18:54 +01:00
in between releases to fix severe bugs. It can also
2021-12-14 23:34:35 +01:00
be used to sync your own code with your RaspiBlitz
2020-04-26 15:39:10 +02:00
if you are developing on your own GitHub Repo.
BUT BEWARE: This means RaspiBlitz will contact GitHub,
hotfix the code and might compromise your security.
Do you want to Patch your RaspiBlitz now?
2020-04-26 15:44:42 +02:00
" 18 58
2020-04-26 15:39:10 +02:00
if [ $? -eq 0 ] ; then
2021-08-03 16:15:32 +02:00
exit 0
2020-04-26 15:39:10 +02:00
fi
2020-04-26 17:56:32 +02:00
}
patch( )
{
2020-04-26 15:39:10 +02:00
# get sync info
2021-06-24 21:20:48 +02:00
source <( sudo /home/admin/config.scripts/blitz.github.sh info)
2020-04-26 15:39:10 +02:00
# Patch Options
2020-04-26 15:43:06 +02:00
OPTIONS = ( PATCH "Patch/Sync RaspiBlitz with GitHub Repo" \
2020-04-26 15:39:10 +02:00
REPO "Change GitHub Repo to sync with" \
2020-09-10 16:15:00 +02:00
BRANCH "Change GitHub Branch to sync with" \
PR "Checkout a PullRequest to test"
2020-04-26 15:39:10 +02:00
)
2021-10-28 11:58:44 +02:00
CHOICE = $( whiptail --clear --title " GitHub user: ${ activeGitHubUser } branch: ${ activeBranch } ( ${ commitHashShort } ) " --menu "" 11 60 4 " ${ OPTIONS [@] } " 2>& 1 >/dev/tty)
2020-04-26 15:39:10 +02:00
clear
case $CHOICE in
PATCH)
2022-05-18 22:02:37 +02:00
echo
echo "#######################################################"
echo "### UPDATE BLITZ --> SCRIPTS (code)"
/home/admin/config.scripts/blitz.github.sh -run
echo
echo "#######################################################"
echo "### UPDATE BLITZ --> API"
sudo /home/admin/config.scripts/blitz.web.api.sh update-code
echo
echo "#######################################################"
echo "### UPDATE BLITZ --> WEBUI"
sudo /home/admin/config.scripts/blitz.web.ui.sh update
sleep 5
2020-04-26 22:06:44 +02:00
whiptail --title " Patching/Syncing " --yes-button "Reboot" --no-button "Skip Reboot" --yesno " OK patching/syncing done.
2020-04-26 18:17:06 +02:00
By default a reboot is advised.
Only skip reboot if you know
it will work without restart.
" 11 40
if [ $? -eq 0 ] ; then
2020-04-26 18:38:42 +02:00
clear
2020-04-26 18:27:02 +02:00
echo "REBOOT .."
2023-12-13 12:11:13 +01:00
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
2020-04-26 18:27:02 +02:00
sleep 8
2021-08-03 16:15:32 +02:00
exit 1
2020-04-26 18:17:06 +02:00
else
2020-04-26 18:27:02 +02:00
echo "SKIP REBOOT .."
2021-08-03 16:15:32 +02:00
exit 0
2020-04-26 18:17:06 +02:00
fi
2020-04-26 15:39:10 +02:00
; ;
REPO)
2020-04-26 20:07:02 +02:00
clear
2020-04-26 22:01:56 +02:00
echo "..."
2020-04-26 20:07:02 +02:00
newGitHubUser = $( whiptail --inputbox "\nPlease enter the GitHub USERNAME of the forked RaspiBlitz Repo?" 10 38 ${ activeGitHubUser } --title "Change Sync Repo" 3>& 1 1>& 2 2>& 3)
exitstatus = $?
if [ $exitstatus = 0 ] ; then
newGitHubUser = $( echo " ${ newGitHubUser } " | cut -d " " -f1)
2020-04-26 21:54:24 +02:00
echo "--> " ${ newGitHubUser }
2020-04-26 22:01:56 +02:00
error = ""
2021-12-19 23:04:49 +01:00
source <( sudo -u admin /home/admin/config.scripts/blitz.github.sh ${ activeBranch } ${ newGitHubUser } )
2020-04-26 21:54:24 +02:00
if [ ${# error } -gt 0 ] ; then
whiptail --title "ERROR" --msgbox " ${ error } " 8 30
fi
2020-04-26 20:07:02 +02:00
fi
2022-11-16 18:21:10 +01:00
patch all
2021-08-03 16:15:32 +02:00
exit 0
2020-04-26 15:39:10 +02:00
; ;
BRANCH)
2020-04-26 20:07:02 +02:00
clear
2020-04-26 22:01:56 +02:00
echo "..."
2020-04-26 20:07:02 +02:00
newGitHubBranch = $( whiptail --inputbox " \nPlease enter the GitHub BRANCH of the RaspiBlitz Repo ' ${ activeGitHubUser } '? " 10 38 ${ activeBranch } --title "Change Sync Branch" 3>& 1 1>& 2 2>& 3)
exitstatus = $?
if [ $exitstatus = 0 ] ; then
newGitHubBranch = $( echo " ${ newGitHubBranch } " | cut -d " " -f1)
echo "--> " $newGitHubBranch
2020-04-26 22:01:56 +02:00
error = ""
2021-06-24 21:20:48 +02:00
source <( sudo -u admin /home/admin/config.scripts/blitz.github.sh ${ newGitHubBranch } )
2020-04-26 21:54:24 +02:00
if [ ${# error } -gt 0 ] ; then
whiptail --title "ERROR" --msgbox " ${ error } " 8 30
fi
2020-04-26 20:07:02 +02:00
fi
2022-11-16 18:21:10 +01:00
patch all
2021-08-03 16:15:32 +02:00
exit 0
2020-04-26 15:39:10 +02:00
; ;
2020-09-10 16:15:00 +02:00
PR)
clear
echo "..."
pullRequestID = $( whiptail --inputbox " \nPlease enter the NUMBER of the PullRequest on RaspiBlitz Repo ' ${ activeGitHubUser } '? " 10 46 --title "Checkout PullRequest ID" 3>& 1 1>& 2 2>& 3)
exitstatus = $?
if [ $exitstatus = 0 ] ; then
pullRequestID = $( echo " ${ pullRequestID } " | cut -d " " -f1)
2020-10-06 21:06:14 +02:00
echo "# --> " $pullRequestID
2020-09-10 16:15:00 +02:00
cd /home/admin/raspiblitz
2020-09-10 21:11:57 +02:00
git fetch origin pull/${ pullRequestID } /head:pr${ pullRequestID }
2020-09-10 16:15:00 +02:00
error = ""
2021-06-24 21:20:48 +02:00
source <( sudo -u admin /home/admin/config.scripts/blitz.github.sh pr${ pullRequestID } )
2020-09-10 16:15:00 +02:00
if [ ${# error } -gt 0 ] ; then
whiptail --title "ERROR" --msgbox " ${ error } " 8 30
2020-10-06 21:06:14 +02:00
else
echo "# update installs .."
2021-06-24 21:20:48 +02:00
/home/admin/config.scripts/blitz.github.sh -justinstall
2020-09-10 16:15:00 +02:00
fi
fi
2021-08-03 16:15:32 +02:00
exit 0
2020-09-10 16:15:00 +02:00
; ;
2020-04-26 15:39:10 +02:00
esac
}
lnd( )
{
2020-04-27 00:13:47 +02:00
# get lnd info
source <( sudo -u admin /home/admin/config.scripts/lnd.update.sh info)
# LND Update Options
2020-07-11 20:40:30 +02:00
OPTIONS = ( )
2020-09-15 16:32:58 +02:00
if [ ${ lndUpdateInstalled } -eq 0 ] ; then
OPTIONS += ( VERIFIED " Optional LND update to ${ lndUpdateVersion } " )
fi
2020-07-11 20:40:30 +02:00
OPTIONS += ( RECKLESS " Experimental LND update to ${ lndLatestVersion } " )
2020-04-27 00:13:47 +02:00
2020-04-27 00:21:36 +02:00
CHOICE = $( whiptail --clear --title "Update LND Options" --menu "" 9 60 2 " ${ OPTIONS [@] } " 2>& 1 >/dev/tty)
2020-04-27 00:13:47 +02:00
clear
case $CHOICE in
2020-04-28 20:55:09 +02:00
VERIFIED)
2020-04-27 00:13:47 +02:00
if [ ${ lndUpdateInstalled } -eq 1 ] ; then
whiptail --title "ALREADY INSTALLED" --msgbox " The LND version ${ lndUpdateVersion } is already installed. " 8 30
2021-08-03 16:15:32 +02:00
exit 0
2020-04-27 00:13:47 +02:00
fi
whiptail --title "OPTIONAL LND UPDATE" --yes-button "Cancel" --no-button "Update" --yesno " BEWARE on updating to LND v ${ lndUpdateVersion } :
${ lndUpdateComment }
Do you really want to update LND now?
" 16 58
if [ $? -eq 0 ] ; then
echo "# cancel update"
2021-08-03 16:15:32 +02:00
exit 0
2020-04-27 00:13:47 +02:00
fi
2020-05-01 18:20:47 +02:00
# if loop is installed remove
if [ " ${ loop } " = = "on" ] ; then
2020-05-14 22:55:27 +02:00
sudo -u admin /home/admin/config.scripts/bonus.loop.sh off
2020-05-01 18:20:47 +02:00
fi
2020-04-27 00:28:09 +02:00
error = ""
2020-05-01 18:20:47 +02:00
warn = ""
2020-04-28 20:55:09 +02:00
source <( sudo -u admin /home/admin/config.scripts/lnd.update.sh verified)
2020-04-27 00:28:09 +02:00
if [ ${# error } -gt 0 ] ; then
whiptail --title "ERROR" --msgbox " ${ error } " 8 30
else
2024-06-09 19:58:54 +02:00
whiptail \
--title " LND update " \
--yes-button "Reboot" \
--no-button "Skip Reboot" \
--yesno \
" OK LND update is done.
By default a reboot is advised to sync macaroons and the TLS certificate.
Consider rebooting later manually if encountering any problems.
" 12 50
if [ $? -eq 0 ] ; then
clear
echo "# REBOOT .."
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
sleep 8
exit 1
else
echo "# SKIP REBOOT"
echo "# starting the lnd.service .."
sudo systemctl start lnd
exit 0
fi
2020-04-27 00:28:09 +02:00
sleep 8
fi
2020-04-27 00:13:47 +02:00
; ;
RECKLESS)
2020-04-27 00:28:09 +02:00
whiptail --title " RECKLESS LND UPDATE to ${ lndLatestVersion } " --yes-button "Cancel" --no-button "Update" --yesno " Using the 'RECKLESS' LND update will simply
2020-04-27 00:13:47 +02:00
grab the latest LND release published on the LND GitHub page ( also release candidates) .
There will be no security checks on signature, etc.
This update mode is only recommended for testing and
2021-12-14 23:34:35 +01:00
development nodes with no serious funding.
2020-04-27 00:13:47 +02:00
Do you really want to update LND now?
" 16 58
if [ $? -eq 0 ] ; then
echo "# cancel update"
2021-08-03 16:15:32 +02:00
exit 0
2020-04-27 00:13:47 +02:00
fi
2020-04-27 00:28:09 +02:00
error = ""
source <( sudo -u admin /home/admin/config.scripts/lnd.update.sh reckless)
if [ ${# error } -gt 0 ] ; then
whiptail --title "ERROR" --msgbox " ${ error } " 8 30
else
2024-06-09 19:58:54 +02:00
whiptail \
--title " LND update " \
--yes-button "Reboot" \
--no-button "Skip Reboot" \
--yesno \
" OK LND update is done.
By default a reboot is advised to sync macaroons and the TLS certificate.
Consider rebooting later manually if encountering any problems.
" 12 50
if [ $? -eq 0 ] ; then
clear
echo "# REBOOT .."
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
sleep 8
exit 1
else
echo "# SKIP REBOOT"
echo "# starting the lnd.service .."
sudo systemctl start lnd
exit 0
fi
2020-04-27 00:28:09 +02:00
sleep 8
fi
2020-04-27 00:13:47 +02:00
; ;
esac
2020-04-26 15:39:10 +02:00
}
2021-09-28 00:34:49 +02:00
cl( )
{
# get cl info
source <( sudo -u admin /home/admin/config.scripts/cl.update.sh info)
2022-07-27 08:37:36 +02:00
# Core Lightning Update Options
2021-09-28 00:34:49 +02:00
OPTIONS = ( )
if [ ${ clUpdateInstalled } -eq 0 ] ; then
2022-07-27 08:37:36 +02:00
OPTIONS += ( VERIFIED " Optional Core Lightning update to ${ clUpdateVersion } " )
2021-09-28 00:34:49 +02:00
fi
2022-07-27 08:37:36 +02:00
OPTIONS += ( RECKLESS " Experimental Core Lightning update to ${ clLatestVersion } " )
2021-09-28 00:34:49 +02:00
2022-07-27 08:37:36 +02:00
CHOICE = $( whiptail --clear --title "Update Core Lightning Options" --menu "" 9 60 2 " ${ OPTIONS [@] } " 2>& 1 >/dev/tty)
2021-09-28 00:34:49 +02:00
clear
case $CHOICE in
VERIFIED)
if [ ${ clUpdateInstalled } -eq 1 ] ; then
2022-07-27 08:37:36 +02:00
whiptail --title "ALREADY INSTALLED" --msgbox " The Core Lightning version ${ clUpdateVersion } is already installed. " 8 30
2021-09-28 00:34:49 +02:00
exit 0
fi
2022-07-27 08:37:36 +02:00
whiptail --title "OPTIONAL Core Lightning UPDATE" --yes-button "Cancel" --no-button "Update" --yesno " BEWARE on updating to Core Lightning v ${ clUpdateVersion } :
2021-09-28 00:34:49 +02:00
${ clUpdateComment }
2022-07-27 08:37:36 +02:00
Do you really want to update Core Lightning now?
2021-09-28 00:34:49 +02:00
" 16 58
if [ $? -eq 0 ] ; then
echo "# cancel update"
exit 0
fi
error = ""
warn = ""
source <( sudo -u admin /home/admin/config.scripts/cl.update.sh verified)
if [ ${# error } -gt 0 ] ; then
whiptail --title "ERROR" --msgbox " ${ error } " 8 30
else
2022-07-27 08:37:36 +02:00
echo "# Core Lightning was updated successfully"
2021-09-28 00:34:49 +02:00
exit 0
fi
; ;
RECKLESS)
2022-12-08 00:29:00 +01:00
whiptail --title " RECKLESS Core Lightning UPDATE to ${ clLatestVersion } " --yes-button "Cancel" --no-button "Update" \
--yesno " Using the 'RECKLESS' Core Lightning update will download the latest Core Lightning release published on the Core Lightning GitHub page.
2021-09-28 00:34:49 +02:00
2022-12-08 00:29:00 +01:00
The update was not tested as a part of the release.
2021-09-28 00:34:49 +02:00
This update mode is only recommended for testing and
2021-12-14 23:34:35 +01:00
development nodes with no serious funding.
2021-09-28 00:34:49 +02:00
2022-07-27 08:37:36 +02:00
Do you really want to update Core Lightning now?
2021-09-28 00:34:49 +02:00
" 16 58
if [ $? -eq 0 ] ; then
echo "# cancel update"
exit 0
fi
error = ""
source <( sudo -u admin /home/admin/config.scripts/cl.update.sh reckless)
if [ ${# error } -gt 0 ] ; then
whiptail --title "ERROR" --msgbox " ${ error } " 8 30
else
2022-07-27 08:37:36 +02:00
echo "# Core Lightning was updated successfully"
2022-12-08 00:29:00 +01:00
# unlock or fix issues from the logs
/home/admin/config.scripts/cl.hsmtool.sh unlock ${ chain } net
2021-09-28 00:34:49 +02:00
exit 0
fi
; ;
esac
}
2021-04-19 16:46:44 +02:00
bitcoinUpdate( ) {
# get bitcoin info
source <( sudo -u admin /home/admin/config.scripts/bitcoin.update.sh info)
# bitcoin update options
OPTIONS = ( )
if [ ${ bitcoinUpdateInstalled } -eq 0 ] ; then
OPTIONS += ( TESTED " Optional Bitcoin Core update to ${ bitcoinVersion } " )
fi
2021-04-20 00:14:46 +02:00
if [ $installedVersion != $bitcoinLatestVersion ] && [ ${ bitcoinVersion } != ${ bitcoinLatestVersion } ] ; then
2021-04-19 16:46:44 +02:00
OPTIONS += ( RECKLESS " Untested Bitcoin Core update to ${ bitcoinLatestVersion } " )
fi
OPTIONS += ( CUSTOM "Update Bitcoin Core to a chosen version" )
2021-04-20 00:14:46 +02:00
CHOICE = $( dialog --clear \
--backtitle "" \
--title "Bitcoin Core Update Options" \
--ok-label "Select" \
--cancel-label "Back" \
--menu "" \
9 60 3 \
" ${ OPTIONS [@] } " 2>& 1 >/dev/tty)
2021-04-19 16:46:44 +02:00
case $CHOICE in
TESTED)
if [ ${ bitcoinUpdateInstalled } -eq 1 ] ; then
whiptail --title "ALREADY INSTALLED" \
--msgbox " The Bitcoin Core version ${ bitcoinUpdateVersion } is already installed. " 8 30
2021-08-03 16:15:32 +02:00
exit 0
2021-04-19 16:46:44 +02:00
fi
whiptail --title "OPTIONAL Bitcoin Core update" --yes-button "Cancel" --no-button "Update" \
--yesno " Info on updating to Bitcoin Core v ${ bitcoinVersion } :
This Bitcoin Core version was tested on this system.
Will verify the binary checksum and signature.
Do you really want to update Bitcoin Core now?
" 12 58
if [ $? -eq 0 ] ; then
echo "# cancel update"
2021-08-03 16:15:32 +02:00
exit 0
2021-04-19 16:46:44 +02:00
fi
error = ""
warn = ""
2023-05-19 01:16:48 +02:00
sudo -u admin /home/admin/config.scripts/bitcoin.update.sh tested
2024-06-09 19:58:54 +02:00
whiptail \
--title " Bitcoin Core update " \
--yes-button "Reboot" \
--no-button "Skip Reboot" \
--yesno \
" OK Bitcoin Core update is done.
By default a reboot is advised.
" 9 40
if [ $? -eq 0 ] ; then
clear
echo "# REBOOT .."
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
sleep 8
exit 1
else
echo "# SKIP REBOOT"
echo "# starting the bitcoind.service .."
sudo systemctl start bitcoind
exit 0
fi
sleep 8
2021-04-19 16:46:44 +02:00
; ;
RECKLESS)
whiptail --title " UNTESTED Bitcoin Core update to ${ bitcoinLatestVersion } " --yes-button "Cancel" \
--no-button "Update" --yesno " Using the 'RECKLESS' Bitcoin Core update will grab
the latest stable Bitcoin Core release published on the Bitcoin Core GitHub page.
This Bitcoin Core version was NOT tested on this system.
Will verify the binary checksum and signature.
Do you really want to update Bitcoin Core now?
" 16 58
if [ $? -eq 0 ] ; then
echo "# cancel update"
2021-08-03 16:15:32 +02:00
exit 0
2021-04-19 16:46:44 +02:00
fi
error = ""
source <( sudo -u admin /home/admin/config.scripts/bitcoin.update.sh reckless)
if [ ${# error } -gt 0 ] ; then
whiptail --title "ERROR" --msgbox " ${ error } " 8 30
fi
2024-06-09 19:58:54 +02:00
whiptail \
--title " Bitcoin Core update " \
--yes-button "Reboot" \
--no-button "Skip Reboot" \
--yesno \
" OK Bitcoin Core update is done.
By default a reboot is advised.
" 9 40
if [ $? -eq 0 ] ; then
clear
echo "REBOOT .."
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
sleep 8
exit 1
else
echo "# SKIP REBOOT"
echo "# starting the bitcoind.service .."
sudo systemctl start bitcoind
exit 0
fi
sleep 8
2021-04-19 16:46:44 +02:00
; ;
CUSTOM)
sudo -u admin /home/admin/config.scripts/bitcoin.update.sh custom
2024-06-09 19:58:54 +02:00
whiptail \
--title " Bitcoin Core update " \
--yes-button "Reboot" \
--no-button "Skip Reboot" \
--yesno \
" OK Bitcoin Core update is done.
By default a reboot is advised.
" 9 40
if [ $? -eq 0 ] ; then
clear
echo "# REBOOT .."
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
sleep 8
exit 1
else
echo "# SKIP REBOOT"
echo "# starting the bitcoind.service .."
sudo systemctl start bitcoind
exit 0
fi
sleep 8
2021-04-19 16:46:44 +02:00
; ;
esac
}
2020-09-16 13:33:14 +02:00
# quick call by parameter
if [ " $1 " = = "github" ] ; then
2022-11-16 18:21:10 +01:00
patch all
2020-09-16 13:33:14 +02:00
exit 0
fi
# Basic Options Menu
2021-04-08 00:24:55 +02:00
WIDTH = 55
2021-08-03 23:15:22 +02:00
OPTIONS = ( )
OPTIONS += ( RELEASE "RaspiBlitz Release Update/Recovery" )
OPTIONS += ( PATCH " Patch RaspiBlitz v ${ codeVersion } " )
OPTIONS += ( BITCOIN "Bitcoin Core Update Options" )
2021-08-30 21:43:39 +02:00
if [ " ${ lightning } " = = "lnd" ] || [ " ${ lnd } " = = "on" ] ; then
2021-08-03 23:15:22 +02:00
OPTIONS += ( LND "Interim LND Update Options" )
fi
2020-09-16 13:33:14 +02:00
2021-09-28 00:34:49 +02:00
if [ " ${ lightning } " = = "cl" ] || [ " ${ cl } " = = "on" ] ; then
2022-07-27 08:37:36 +02:00
OPTIONS += ( CL "Interim Core Lightning Update Options" )
2021-09-28 00:34:49 +02:00
fi
2020-09-16 13:33:14 +02:00
if [ " ${ bos } " = = "on" ] ; then
OPTIONS += ( BOS "Update Balance of Satoshis" )
fi
2021-08-03 23:15:22 +02:00
2022-11-04 15:50:54 +01:00
if [ " ${ ElectRS } " = = "on" ] ; then
OPTIONS += ( ELECTRS "Update Electrs" )
fi
2022-09-29 20:46:24 +02:00
if [ " ${ RTL } " = = "on" ] || [ " ${ cRTL } " = = "on" ] ; then
OPTIONS += ( RTL "Update RTL" )
fi
2020-09-16 13:33:14 +02:00
if [ " ${ thunderhub } " = = "on" ] ; then
OPTIONS += ( THUB "Update ThunderHub" )
fi
2021-08-03 23:15:22 +02:00
2022-12-09 21:49:44 +01:00
if [ " ${ lndg } " = = "on" ] ; then
OPTIONS += ( LNDG "Update LNDg" )
fi
2023-05-15 11:44:43 +02:00
## Disabled for now until the base image has Python 3.10
2024-05-28 21:56:45 +02:00
if [ " ${ specter } " = = "on" ] ; then
OPTIONS += ( SPECTER "Update Specter Desktop" )
fi
2021-08-03 23:15:22 +02:00
2021-11-30 12:43:52 +01:00
if [ " ${ BTCPayServer } " = = "on" ] ; then
OPTIONS += ( BTCPAY "Update BTCPayServer" )
fi
2021-03-22 22:10:54 +01:00
if [ " ${ sphinxrelay } " = = "on" ] ; then
OPTIONS += ( SPHINX "Update Sphinx Server Relay" )
fi
2021-08-03 23:15:22 +02:00
2021-04-19 16:46:44 +02:00
if [ " ${ mempoolExplorer } " = = "on" ] ; then
OPTIONS += ( MEMPOOL "Update Mempool Explorer" )
fi
2021-08-03 23:15:22 +02:00
2022-11-01 16:47:54 +01:00
if [ " ${ jam } " = = "on" ] ; then
OPTIONS += ( JAM "Update Jam (JoinMarket WebUI)" )
fi
2020-11-15 23:16:13 +01:00
if [ " ${ runBehindTor } " = = "on" ] ; then
2022-06-22 11:23:52 +02:00
OPTIONS += ( TOR "Update Tor from the Torproject repo" )
2020-11-15 23:16:13 +01:00
fi
2020-09-16 13:33:14 +02:00
2021-08-16 16:41:23 +02:00
CHOICE_HEIGHT = $(( " ${# OPTIONS [@] } /2+1 " ))
2021-12-14 23:34:35 +01:00
HEIGHT = $(( CHOICE_HEIGHT+6))
2021-04-08 00:24:55 +02:00
CHOICE = $( dialog --clear \
--backtitle "" \
2021-08-30 21:43:39 +02:00
--title " Update Options " \
2021-04-08 00:24:55 +02:00
--ok-label "Select" \
--cancel-label "Main menu" \
--menu "" \
$HEIGHT $WIDTH $CHOICE_HEIGHT \
" ${ OPTIONS [@] } " 2>& 1 >/dev/tty)
2020-09-16 13:33:14 +02:00
2020-04-26 15:39:10 +02:00
case $CHOICE in
RELEASE)
release
; ;
PATCH)
2020-04-26 17:56:32 +02:00
patchNotice
2022-11-16 18:21:10 +01:00
patch all
2020-04-26 15:39:10 +02:00
; ;
LND)
lnd
; ;
2021-09-28 00:34:49 +02:00
CL)
cl
; ;
2021-04-19 16:46:44 +02:00
BITCOIN)
bitcoinUpdate
; ;
2020-06-01 12:32:28 +02:00
BOS)
/home/admin/config.scripts/bonus.bos.sh update
; ;
2022-11-04 15:50:54 +01:00
ELECTRS)
/home/admin/config.scripts/bonus.electrs.sh update
2022-12-08 00:29:00 +01:00
; ;
2022-09-29 20:46:24 +02:00
RTL)
/home/admin/config.scripts/bonus.rtl.sh update
; ;
2020-06-01 12:32:28 +02:00
THUB)
/home/admin/config.scripts/bonus.thunderhub.sh update
; ;
2022-12-09 21:49:44 +01:00
LNDG)
/home/admin/config.scripts/bonus.lndg.sh update
; ;
2020-09-02 11:11:50 +02:00
SPECTER)
2021-08-23 18:23:01 +02:00
/home/admin/config.scripts/bonus.specter.sh update
2020-09-02 11:11:50 +02:00
; ;
2021-11-30 12:43:52 +01:00
BTCPAY)
/home/admin/config.scripts/bonus.btcpayserver.sh update
; ;
2020-11-27 00:53:54 +01:00
SPHINX)
/home/admin/config.scripts/bonus.sphinxrelay.sh update
; ;
2020-11-15 23:16:13 +01:00
TOR)
2021-12-14 23:34:35 +01:00
sudo /home/admin/config.scripts/tor.network.sh update
2020-11-15 23:16:13 +01:00
; ;
2021-04-08 01:10:12 +02:00
MEMPOOL)
2021-12-14 23:34:35 +01:00
/home/admin/config.scripts/bonus.mempool.sh update
2021-04-08 01:10:12 +02:00
; ;
2022-11-01 16:47:54 +01:00
JAM)
/home/admin/config.scripts/bonus.jam.sh update
; ;
2020-08-23 12:15:49 +02:00
esac