mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-03-01 00:59:23 +01:00
CLN: less reckless update, consistent leading v (#3835)
* CLN: less reckless update, consistent leading v * check in app-data as root and add output * check if clUpdateVersion is already installed
This commit is contained in:
parent
2d5e4f2dcc
commit
dbbdaf91fc
2 changed files with 32 additions and 13 deletions
|
@ -243,13 +243,27 @@ fi
|
||||||
if [ ${#clInterimsUpdate} -gt 0 ]; then
|
if [ ${#clInterimsUpdate} -gt 0 ]; then
|
||||||
/home/admin/_cache.sh set message "Provisioning CL update"
|
/home/admin/_cache.sh set message "Provisioning CL update"
|
||||||
if [ "${clInterimsUpdate}" == "reckless" ]; then
|
if [ "${clInterimsUpdate}" == "reckless" ]; then
|
||||||
|
# determine the database version # Examples: 216 is CLN v23.02.2 # 219 is CLN v23.05
|
||||||
|
clDbVersion=$(sqlite3 /mnt/hdd/app-data/.lightning/bitcoin/lightningd.sqlite3 "SELECT version FROM version;")
|
||||||
|
if [ ${#clDbVersion} -eq 0 ]; then
|
||||||
|
echo "Could not determine the CLN database version - using 0" >> ${logFile}
|
||||||
|
clDbVersion=0
|
||||||
|
else
|
||||||
|
echo "The CLN database version is ${clDbVersion}" >> ${logFile}
|
||||||
|
fi
|
||||||
|
if [ ${clDbVersion} -lt 217 ]; then
|
||||||
|
# even if reckless is set - update to the recommended release
|
||||||
|
echo "Provisioning CL verified interims update" >> ${logFile}
|
||||||
|
/home/admin/config.scripts/cl.update.sh verified >> ${logFile}
|
||||||
|
else # 217 or higher
|
||||||
# recklessly update CL to latest release on GitHub (just for test & dev nodes)
|
# recklessly update CL to latest release on GitHub (just for test & dev nodes)
|
||||||
echo "Provisioning CL reckless interims update" >> ${logFile}
|
echo "Provisioning CL reckless interims update" >> ${logFile}
|
||||||
/home/admin/config.scripts/cl.update.sh reckless >> ${logFile}
|
/home/admin/config.scripts/cl.update.sh reckless >> ${logFile}
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
# when installing the same sd image - this will re-trigger the secure interims update
|
# when installing the same sd image - this will re-trigger the secure interims update
|
||||||
# if this a update with a newer RaspiBlitz version .. interims update will be ignored
|
# if this is an update with a newer RaspiBlitz version .. interims update will be ignored
|
||||||
# because standard CL version is most more up to date
|
# because the standard CL version is up to date
|
||||||
echo "Provisioning CL verified interims update" >> ${logFile}
|
echo "Provisioning CL verified interims update" >> ${logFile}
|
||||||
/home/admin/config.scripts/cl.update.sh verified ${clInterimsUpdate} >> ${logFile}
|
/home/admin/config.scripts/cl.update.sh verified ${clInterimsUpdate} >> ${logFile}
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -9,7 +9,7 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||||
echo "verified -> only do recommended updates by RaspiBlitz team"
|
echo "verified -> only do recommended updates by RaspiBlitz team"
|
||||||
echo " binary will be checked by signature and checksum"
|
echo " binary will be checked by signature and checksum"
|
||||||
echo "reckless -> if you just want to update to the latest release"
|
echo "reckless -> if you just want to update to the latest release"
|
||||||
echo " published on Core Lightning GitHub releases (RC or final) without any"
|
echo " published on Core Lightning GitHub releases without any"
|
||||||
echo " testing or security checks."
|
echo " testing or security checks."
|
||||||
echo
|
echo
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -20,13 +20,13 @@ mode="$1"
|
||||||
|
|
||||||
# RECOMMENDED UPDATE BY RASPIBLITZ TEAM
|
# RECOMMENDED UPDATE BY RASPIBLITZ TEAM
|
||||||
# comment will be shown as "BEWARE Info" when option is choosen (can be multiple lines)
|
# comment will be shown as "BEWARE Info" when option is choosen (can be multiple lines)
|
||||||
clUpdateVersion="" # example: 0.12.1 .. keep empty if no newer version as sd card build is available
|
clUpdateVersion="v23.02.2" # example: v23.02.2 # keep empty if no newer version as sd card build is available
|
||||||
clUpdateComment="Please keep in mind that downgrading afterwards is not tested. Also not all additional apps are fully tested with the this update - but it looked good on first tests."
|
clUpdateComment="Please keep in mind that downgrading afterwards is not tested. Also not all additional apps are fully tested with the this update - but it looked good on first tests."
|
||||||
|
|
||||||
# GATHER DATA
|
# GATHER DATA
|
||||||
|
|
||||||
# installed Core Lightning version
|
# installed Core Lightning version
|
||||||
clInstalledVersion=$(sudo -u bitcoin lightning-cli --version)
|
clInstalledVersion=$(sudo -u bitcoin lightningd --version) # example output: v23.02.2
|
||||||
clInstalledVersionMajor=$(echo "${clInstalledVersion}" | cut -d "-" -f1 | cut -d "." -f1)
|
clInstalledVersionMajor=$(echo "${clInstalledVersion}" | cut -d "-" -f1 | cut -d "." -f1)
|
||||||
clInstalledVersionMain=$(echo "${clInstalledVersion}" | cut -d "-" -f1 | cut -d "." -f2)
|
clInstalledVersionMain=$(echo "${clInstalledVersion}" | cut -d "-" -f1 | cut -d "." -f2)
|
||||||
clInstalledVersionMinor=$(echo "${clInstalledVersion}" | cut -d "-" -f1 | cut -d "." -f3)
|
clInstalledVersionMinor=$(echo "${clInstalledVersion}" | cut -d "-" -f1 | cut -d "." -f3)
|
||||||
|
@ -36,7 +36,7 @@ clUpdateInstalled=$(echo "${clInstalledVersion}" | grep -c "${clUpdateVersion}")
|
||||||
|
|
||||||
# get latest release from Core Lightning GitHub releases without release candidates
|
# get latest release from Core Lightning GitHub releases without release candidates
|
||||||
clLatestVersion=$(curl --header "X-GitHub-Api-Version:2022-11-28" -s https://api.github.com/repos/ElementsProject/lightning/releases | jq -r '.[].tag_name' | grep -v "rc" | head -n1)
|
clLatestVersion=$(curl --header "X-GitHub-Api-Version:2022-11-28" -s https://api.github.com/repos/ElementsProject/lightning/releases | jq -r '.[].tag_name' | grep -v "rc" | head -n1)
|
||||||
# example: v0.12.1
|
# example output: v23.05
|
||||||
|
|
||||||
# INFO
|
# INFO
|
||||||
if [ "${mode}" = "info" ]; then
|
if [ "${mode}" = "info" ]; then
|
||||||
|
@ -80,7 +80,13 @@ if [ "${mode}" = "verified" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ${#clUpdateVersion} -gt 0 ]; then
|
if [ ${#clUpdateVersion} -gt 0 ]; then
|
||||||
/home/admin/config.scripts/cl.install.sh update v${clUpdateVersion}
|
# only update if the clUpdateVersion is different from the installed
|
||||||
|
if [ "${clInstalledVersion}" = "${clUpdateVersion}" ]; then
|
||||||
|
echo "# clInstalledVersion = clUpdateVersion (${clUpdateVersion})"
|
||||||
|
echo "# There is no need to update again."
|
||||||
|
else
|
||||||
|
/home/admin/config.scripts/cl.install.sh update ${clUpdateVersion}
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
/home/admin/config.scripts/cl.install.sh on
|
/home/admin/config.scripts/cl.install.sh on
|
||||||
fi
|
fi
|
||||||
|
@ -100,10 +106,9 @@ if [ "${mode}" = "reckless" ]; then
|
||||||
|
|
||||||
# only update if the latest release is different from the installed
|
# only update if the latest release is different from the installed
|
||||||
if [ "${clInstalledVersion}" = "${clLatestVersion}" ]; then
|
if [ "${clInstalledVersion}" = "${clLatestVersion}" ]; then
|
||||||
# attention to leading 'v'
|
echo "# clInstalledVersion = clLatestVersion (${clLatestVersion})"
|
||||||
echo "# clInstalledVersion = clLatestVersion (${clLatestVersion:1})"
|
|
||||||
echo "# There is no need to update again."
|
echo "# There is no need to update again."
|
||||||
clInterimsUpdateNew="${clLatestVersion:1}"
|
clInterimsUpdateNew="${clLatestVersion}"
|
||||||
else
|
else
|
||||||
/home/admin/config.scripts/cl.install.sh update ${clLatestVersion}
|
/home/admin/config.scripts/cl.install.sh update ${clLatestVersion}
|
||||||
clInterimsUpdateNew="reckless"
|
clInterimsUpdateNew="reckless"
|
||||||
|
|
Loading…
Add table
Reference in a new issue