mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-10-10 12:53:01 +02:00
Add update menu for electrs v0.9.9 (#3402)
Add UPDATE - ELECTRS menu entry Add update method to script with update to the latest release tag.
This commit is contained in:
@@ -476,6 +476,10 @@ if [ "${bos}" == "on" ]; then
|
|||||||
OPTIONS+=(BOS "Update Balance of Satoshis")
|
OPTIONS+=(BOS "Update Balance of Satoshis")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "${ElectRS}" == "on" ]; then
|
||||||
|
OPTIONS+=(ELECTRS "Update Electrs")
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${RTL}" == "on" ]||[ "${cRTL}" == "on" ]; then
|
if [ "${RTL}" == "on" ]||[ "${cRTL}" == "on" ]; then
|
||||||
OPTIONS+=(RTL "Update RTL")
|
OPTIONS+=(RTL "Update RTL")
|
||||||
fi
|
fi
|
||||||
@@ -547,6 +551,9 @@ case $CHOICE in
|
|||||||
BOS)
|
BOS)
|
||||||
/home/admin/config.scripts/bonus.bos.sh update
|
/home/admin/config.scripts/bonus.bos.sh update
|
||||||
;;
|
;;
|
||||||
|
ELECTRS)
|
||||||
|
/home/admin/config.scripts/bonus.electrs.sh update
|
||||||
|
;;
|
||||||
RTL)
|
RTL)
|
||||||
/home/admin/config.scripts/bonus.rtl.sh update
|
/home/admin/config.scripts/bonus.rtl.sh update
|
||||||
;;
|
;;
|
||||||
|
@@ -10,7 +10,7 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
|||||||
echo "config script to switch the Electrum Rust Server on or off"
|
echo "config script to switch the Electrum Rust Server on or off"
|
||||||
echo "bonus.electrs.sh status -> dont call in loops"
|
echo "bonus.electrs.sh status -> dont call in loops"
|
||||||
echo "bonus.electrs.sh status-sync"
|
echo "bonus.electrs.sh status-sync"
|
||||||
echo "bonus.electrs.sh [on|off|menu]"
|
echo "bonus.electrs.sh [on|off|menu|update]"
|
||||||
echo "installs the version $ELECTRSVERSION"
|
echo "installs the version $ELECTRSVERSION"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -510,5 +510,28 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$1" = "update" ]; then
|
||||||
|
echo "# Update Electrs"
|
||||||
|
cd /home/electrs/electrs || exit 1
|
||||||
|
sudo -u electrs git fetch
|
||||||
|
|
||||||
|
localVersion=$(git describe --tag)
|
||||||
|
updateVersion=$(curl -s https://api.github.com/repos/romanz/electrs/releases/latest|grep tag_name|head -1|cut -d '"' -f4)
|
||||||
|
|
||||||
|
if [ $localVersion = $updateVersion ]; then
|
||||||
|
echo "# Up-to-date on version $localVersion"
|
||||||
|
else
|
||||||
|
echo "# Pulling latest changes..."
|
||||||
|
sudo -u electrs git pull -p
|
||||||
|
echo "# Reset to the latest release tag: $updateVersion"
|
||||||
|
sudo -u electrs git reset --hard $updateVersion
|
||||||
|
echo "# Build Electrs ..."
|
||||||
|
sudo -u electrs /home/electrs/.cargo/bin/cargo build --locked --release || exit 1
|
||||||
|
echo "# Updated Electrs to $updateVersion"
|
||||||
|
fi
|
||||||
|
sudo systemctl start electrs
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
echo "# FAIL - Unknown Parameter $1"
|
echo "# FAIL - Unknown Parameter $1"
|
||||||
exit 1
|
exit 1
|
||||||
|
Reference in New Issue
Block a user