update options for BoS and THub

This commit is contained in:
openoms 2020-06-01 11:32:28 +01:00
parent bd62539c2f
commit 536c4411a0
No known key found for this signature in database
GPG Key ID: 5BFB77609B081B65
3 changed files with 39 additions and 4 deletions

View File

@ -13,6 +13,13 @@ OPTIONS=(RELEASE "RaspiBlitz Release Update/Recovery" \
PATCH "Patch RaspiBlitz v${codeVersion}"
)
if [ "${bos}" == "on" ]; then
OPTIONS+=(BOS "Update Balance of Satoshis")
fi
if [ "${thunderhub}" == "on" ]; then
OPTIONS+=(THUB "Update ThunderHub")
fi
CHOICE=$(whiptail --clear --title "Update Options" --menu "" 10 55 3 "${OPTIONS[@]}" 2>&1 >/dev/tty)
release()
@ -265,4 +272,10 @@ case $CHOICE in
LND)
lnd
;;
BOS)
/home/admin/config.scripts/bonus.bos.sh update
;;
THUB)
/home/admin/config.scripts/bonus.thunderhub.sh update
;;
esac

View File

@ -2,8 +2,8 @@
# command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo "config script to install or uninstall balance of satoshis"
echo "bonus.bos.sh [on|off|menu]"
echo "config script to install, update or uninstall Balance of Satoshis"
echo "bonus.bos.sh [on|off|menu|update]"
exit 1
fi
@ -84,5 +84,13 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
fi
# update
if [ "$1" = "update" ]; then
echo "*** UPDATING BALANCE OF SATOSHIS ***"
sudo -u bos npm i -g balanceofsatoshis
echo "*** Balance of Satoshis is updated to the latest in https://github.com/alexbosworth/balanceofsatoshis ***"
exit 0
fi
echo "FAIL - Unknown Parameter $1"
exit 1

View File

@ -2,8 +2,8 @@
# command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo "small config script to switch ThunderHub on or off"
echo "bonus.thunderhub.sh [on|off|menu]"
echo "config script to install, update or uninstall ThunderHub"
echo "bonus.thunderhub.sh [on|off|menu|update]"
exit 1
fi
@ -202,5 +202,19 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
exit 0
fi
# update
if [ "$1" = "update" ]; then
echo "*** UPDATING THUNDERHUB ***"
cd /home/thunderhub/thunderhub
sudo -u thunderhub git pull
sudo -u thunderhub npm install
sudo -u thunderhub npm run build
echo "*** ThunderHub is updated to the latest in https://github.com/apotdevin/thunderhub ***"
echo ""
echo "*** Starting the ThunderHub service ... *** "
sudo systemctl start thunderhub
exit 0
fi
echo "FAIL - Unknown Parameter $1"
exit 1