RTL update to v0.9.1 + UPDATE option (#1659)

This commit is contained in:
openoms 2020-10-13 08:45:17 +01:00 committed by GitHub
parent c5a3a6c645
commit 633c564162
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 54 additions and 11 deletions

View File

@ -291,6 +291,9 @@ fi
if [ "${specter}" == "on" ]; then if [ "${specter}" == "on" ]; then
OPTIONS+=(SPECTER "Update Cryptoadvance Specter") OPTIONS+=(SPECTER "Update Cryptoadvance Specter")
fi fi
if [ "${rtlWebinterface}" == "on" ]; then
OPTIONS+=(RTL "Update RTL")
fi
CHOICE=$(whiptail --clear --title "Update Options" --menu "" 13 55 6 "${OPTIONS[@]}" 2>&1 >/dev/tty) CHOICE=$(whiptail --clear --title "Update Options" --menu "" 13 55 6 "${OPTIONS[@]}" 2>&1 >/dev/tty)
@ -315,4 +318,7 @@ case $CHOICE in
SPECTER) SPECTER)
/home/admin/config.scripts/bonus.cryptoadvance-specter.sh update /home/admin/config.scripts/bonus.cryptoadvance-specter.sh update
;; ;;
RTL)
/home/admin/config.scripts/bonus.rtl.sh update
;;
esac esac

View File

@ -89,7 +89,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
sudo -u rtl git clone https://github.com/ShahanaFarooqui/RTL.git /home/rtl/RTL sudo -u rtl git clone https://github.com/ShahanaFarooqui/RTL.git /home/rtl/RTL
cd /home/rtl/RTL cd /home/rtl/RTL
# check https://github.com/Ride-The-Lightning/RTL/releases/ # check https://github.com/Ride-The-Lightning/RTL/releases/
sudo -u rtl git reset --hard v0.9.0 sudo -u rtl git reset --hard v0.9.1
# from https://github.com/Ride-The-Lightning/RTL/commits/master # from https://github.com/Ride-The-Lightning/RTL/commits/master
# git checkout 917feebfa4fb583360c140e817c266649307ef72 # git checkout 917feebfa4fb583360c140e817c266649307ef72
if [ -d "/home/rtl/RTL" ]; then if [ -d "/home/rtl/RTL" ]; then
@ -246,6 +246,39 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
exit 0 exit 0
fi fi
# update
if [ "$1" = "update" ]; then
echo "# UPDATING RTL"
cd /home/rtl/RTL
# from https://github.com/apotdevin/thunderhub/blob/master/scripts/updateToLatest.sh
# fetch latest master
sudo -u rtl git fetch
# unset $1
set --
UPSTREAM=${1:-'@{u}'}
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse "$UPSTREAM")
if [ $LOCAL = $REMOTE ]; then
TAG=$(git tag | sort -V | tail -1)
echo "# You are up-to-date on version" $TAG
else
echo "# Pulling latest changes..."
sudo -u rtl git pull -p
echo "# Reset to the latest release tag"
TAG=$(git tag | sort -V | tail -1)
sudo -u rtl git reset --hard $TAG
# https://github.com/Ride-The-Lightning/RTL#or-update-existing-dependencies
sudo -u rtl npm install --only=prod
echo "# Updated to version" $TAG
fi
echo "# Updated to the latest in https://github.com/Ride-The-Lightning/RTL/releases"
echo ""
echo "# Starting the RTL service ... "
sudo systemctl start RTL
exit 0
fi
echo "FAIL - Unknown Parameter $1" echo "FAIL - Unknown Parameter $1"
echo "may need reboot to run normal again" echo "may need reboot to run normal again"
exit 1 exit 1

View File

@ -279,41 +279,45 @@ fi
# update # update
if [ "$1" = "update" ]; then if [ "$1" = "update" ]; then
echo "*** UPDATING THUNDERHUB ***" echo "# UPDATING THUNDERHUB"
cd /home/thunderhub/thunderhub cd /home/thunderhub/thunderhub
# from https://github.com/apotdevin/thunderhub/blob/master/scripts/updateToLatest.sh # from https://github.com/apotdevin/thunderhub/blob/master/scripts/updateToLatest.sh
# fetch latest master # fetch latest master
sudo -u thunderhub git fetch sudo -u thunderhub git fetch
# unset $1
set --
UPSTREAM=${1:-'@{u}'} UPSTREAM=${1:-'@{u}'}
LOCAL=$(git rev-parse @) LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse "$UPSTREAM") REMOTE=$(git rev-parse "$UPSTREAM")
if [ $LOCAL = $REMOTE ]; then if [ $LOCAL = $REMOTE ]; then
TAG=$(git tag | sort -V | tail -1) TAG=$(git tag | sort -V | tail -1)
echo "You are up-to-date on version" $TAG echo "# Up-to-date on version" $TAG
else else
echo "Pulling latest changes..." echo "# Pulling latest changes..."
sudo -u thunderhub git pull -p sudo -u thunderhub git pull -p
echo "# Reset to the latest release tag"
TAG=$(git tag | sort -V | tail -1)
sudo -u thunderhub git reset --hard $TAG
# install deps # install deps
echo "Installing dependencies..." echo "# Installing dependencies..."
sudo -u thunderhub npm install --quiet sudo -u thunderhub npm install --quiet
if ! [ $? -eq 0 ]; then if ! [ $? -eq 0 ]; then
echo "FAIL - npm install did not run correctly, aborting" echo "# FAIL - npm install did not run correctly, aborting"
exit 1 exit 1
fi fi
# build nextjs # build nextjs
echo "Building application..." echo "# Building application..."
sudo -u thunderhub npm run build sudo -u thunderhub npm run build
TAG=$(git tag | sort -V | tail -1) echo "# Updated to version" $TAG
echo "Updated to version" $TAG
fi fi
echo "*** Updated to the latest in https://github.com/apotdevin/thunderhub ***" echo "# Updated to the release in https://github.com/apotdevin/thunderhub"
echo "" echo ""
echo "*** Starting the ThunderHub service ... *** " echo "# Starting the ThunderHub service ... *** "
sudo systemctl start thunderhub sudo systemctl start thunderhub
exit 0 exit 0
fi fi