From 05ea1fe65f97acb7b13f9511a0b2ed28512d30a6 Mon Sep 17 00:00:00 2001 From: Lars Berning <151194+laberning@users.noreply.github.com> Date: Sat, 19 Feb 2022 21:33:45 +0100 Subject: [PATCH] updatescript can now restart GUI after update --- bin/updateopenrowingmonitor.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/bin/updateopenrowingmonitor.sh b/bin/updateopenrowingmonitor.sh index a30278e..d74b650 100755 --- a/bin/updateopenrowingmonitor.sh +++ b/bin/updateopenrowingmonitor.sh @@ -59,12 +59,20 @@ update_branch() { sudo git reset --hard origin/$CURRENT_BRANCH print "Updating Runtime dependencies..." + sudo rm -rf node_modules + sudo rm -rf build sudo npm ci sudo npm run build print "Starting Open Rowing Monitor..." sudo systemctl start openrowingmonitor + browserservice="webbrowserkiosk.service" + if systemctl --all --type service | grep -q "$browserservice" && systemctl is-active --quiet "$browserservice";then + echo "Restarting Graphical User Interface..." + sudo systemctl restart "$browserservice" + fi + print print "Update complete, Open Rowing Monitor now has the following exciting new features:" git log --reverse --pretty=format:"- %s" $LOCAL_VERSION..HEAD @@ -83,12 +91,19 @@ switch_branch() { print "Updating Runtime dependencies..." sudo rm -rf node_modules - sudo npm install + sudo rm -rf build + sudo npm ci sudo npm run build print "Starting Open Rowing Monitor..." sudo systemctl start openrowingmonitor + browserservice="webbrowserkiosk.service" + if systemctl --all --type service | grep -q "$browserservice" && systemctl is-active --quiet "$browserservice";then + echo "Restarting Graphical User Interface..." + sudo systemctl restart "$browserservice" + fi + print print "Switch to branch \"$CURRENT_BRANCH\" complete, Open Rowing Monitor now has the following exciting new features:" git log --reverse --pretty=format:"- %s" $LOCAL_VERSION..HEAD