From df3439dee7345c09c0a064067851fbee04a940cf Mon Sep 17 00:00:00 2001 From: openoms Date: Wed, 3 Jun 2020 09:56:30 +0100 Subject: [PATCH 1/2] thunderhub: fix chmod, pin version to v0.6.13 --- home.admin/config.scripts/bonus.thunderhub.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/home.admin/config.scripts/bonus.thunderhub.sh b/home.admin/config.scripts/bonus.thunderhub.sh index c60b718aa..f1098ea10 100644 --- a/home.admin/config.scripts/bonus.thunderhub.sh +++ b/home.admin/config.scripts/bonus.thunderhub.sh @@ -75,6 +75,8 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then # download and install sudo -u thunderhub git clone https://github.com/apotdevin/thunderhub.git /home/thunderhub/thunderhub cd /home/thunderhub/thunderhub + # https://github.com/apotdevin/thunderhub/releases + sudo -u thunderhub git reset --hard v0.6.13 echo "Running npm install and run build..." sudo -u thunderhub npm install sudo -u thunderhub npm run build @@ -139,7 +141,7 @@ EOF sudo rm -f /home/thunderhub/thubConfig.yaml sudo mv /home/admin/thubConfig.yaml /home/thunderhub/thubConfig.yaml sudo chown thunderhub:thunderhub /home/thunderhub/thubConfig.yaml - sudo chown 600 /home/thunderhub/thubConfig.yaml | exit 1 + sudo chmod 600 /home/thunderhub/thubConfig.yaml | exit 1 ################## # SYSTEMD SERVICE @@ -191,9 +193,11 @@ fi if [ "$1" = "0" ] || [ "$1" = "off" ]; then echo "*** REMOVING THUNDERHUB ***" - sudo userdel -rf thunderhub + # remove systemd service sudo systemctl disable thunderhub sudo rm -f /etc/systemd/system/thunderhub.service + # delete user and home directory + sudo userdel -rf thunderhub echo "OK ThunderHub removed." # setting value in raspi blitz config From 18c54da5ca7d43ebdc356af8959463d24ed8acc0 Mon Sep 17 00:00:00 2001 From: openoms Date: Wed, 3 Jun 2020 10:30:36 +0100 Subject: [PATCH 2/2] thunderhub: start service after install --- home.admin/00settingsMenuServices.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/home.admin/00settingsMenuServices.sh b/home.admin/00settingsMenuServices.sh index 8dbf6cb48..7cfa861d1 100644 --- a/home.admin/00settingsMenuServices.sh +++ b/home.admin/00settingsMenuServices.sh @@ -638,12 +638,22 @@ fi choice="off"; check=$(echo "${CHOICES}" | grep -c "t") if [ ${check} -eq 1 ]; then choice="on"; fi if [ "${thunderhub}" != "${choice}" ]; then - echo " ThunderHub setting changed .." + echo "ThunderHub Setting changed .." anychange=1 - sudo -u admin /home/admin/config.scripts/bonus.thunderhub.sh ${choice} - source /mnt/hdd/raspiblitz.conf - if [ "${thunderhub}" = "on" ]; then - sudo -u admin /home/admin/config.scripts/bonus.thunderhub.sh menu + /home/admin/config.scripts/bonus.thunderhub.sh ${choice} + errorOnInstall=$? + if [ "${choice}" = "on" ]; then + if [ ${errorOnInstall} -eq 0 ]; then + sudo systemctl start thunderhub + echo "waiting 10 secs .." + sleep 10 + /home/admin/config.scripts/bonus.thunderhub.sh menu + else + l1="!!! FAIL on ThunderHub install !!!" + l2="Try manual install on terminal after reboot with:" + l3="/home/admin/config.scripts/bonus.thunderhub.sh on" + dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65 + fi fi else echo "ThunderHub setting unchanged."