fix pyblock update and add it to the update menu (#1686)

This commit is contained in:
Holger Nahrstaedt 2020-10-20 10:45:47 +00:00 committed by rootzoll
parent 4563ada47c
commit 41f99b34b6
2 changed files with 8 additions and 1 deletions

View file

@ -294,6 +294,9 @@ fi
if [ "${rtlWebinterface}" == "on" ]; then if [ "${rtlWebinterface}" == "on" ]; then
OPTIONS+=(RTL "Update RTL") OPTIONS+=(RTL "Update RTL")
fi fi
if [ "${pyblock}" == "on" ]; then
OPTIONS+=(PYBLOCK "Update PyBLOCK")
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)
@ -321,4 +324,7 @@ case $CHOICE in
RTL) RTL)
/home/admin/config.scripts/bonus.rtl.sh update /home/admin/config.scripts/bonus.rtl.sh update
;; ;;
PYBLOCK)
/home/admin/config.scripts/bonus.pyblock.sh update
;;
esac esac

View file

@ -104,7 +104,8 @@ fi
if [ "$1" = "update" ]; then if [ "$1" = "update" ]; then
echo "*** UPDATING PyBLOCK ***" echo "*** UPDATING PyBLOCK ***"
cd /home/pyblock/PyBLOCK cd /home/pyblock/PyBLOCK
sudo -u pyblock git update sudo -u pyblock git pull
sudo -u pyblock pip3 install -r requirements.txt
echo "*** Updated to the latest in https://github.com/curly60e/pyblock ***" echo "*** Updated to the latest in https://github.com/curly60e/pyblock ***"
exit 0 exit 0
fi fi