From 317b2088f0d6339538d50fd7410e8e5fe4960807 Mon Sep 17 00:00:00 2001 From: Martin Winkler Date: Tue, 11 Feb 2020 11:36:21 +0100 Subject: [PATCH] Add step to upgrade to latest version Raised dependency to sequencer 10 --- seqs/pyload.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/seqs/pyload.sh b/seqs/pyload.sh index 138500a..ee71693 100755 --- a/seqs/pyload.sh +++ b/seqs/pyload.sh @@ -2,6 +2,7 @@ toolName="pyload" toolUser="${toolName}" toolBranch="stable" +toolLoc=/opt/pyload toolDownload="https://github.com/pyload/pyload.git" toolDeps="git liblept5 python python-crypto python-pycurl python-imaging python-sleekxmpp tesseract-ocr zip unzip python-openssl libmozjs-24-bin" toolBuildDeps="rar unrar-nonfree" @@ -34,10 +35,8 @@ step_2() { step_3_info() { echo "Get $toolName from $toolDownload and create dedicated user"; } step_3() { - cd /opt - exe git clone -b $toolBranch $toolDownload - saveReturn $? - endReturn + exe git clone -b $toolBranch $toolDownload "$toolLoc" + endReturn -o $? "Git clone failed" exe adduser --system "$toolUser" } @@ -45,7 +44,7 @@ step_4_info() { echo "Make initial configuration"; } step_4() { echo "Webinterface server \"threaded\" is recommended on a raspberry pi." exe read -p "Press Enter to continue: " - cd /opt/pyload + exe cd "$toolLoc" exe sudo -u $toolUser python pyLoadCore.py } @@ -53,7 +52,6 @@ step_5_info() { echo "Create systemd service"; } step_5() { addConf -c "$toolService" "$toolServiceLoc" } - toolServiceLoc="/etc/systemd/system/pyload.service" toolService="\ [Unit] @@ -67,5 +65,13 @@ ExecStart=/usr/bin/python /opt/pyload/pyLoadCore.py [Install] WantedBy=multi-user.target" -VERSION_SEQREV=5 -. sequencer.sh +step_10_info() { echo "Upgrade to latest version of branch $toolBranch"; } +step_10_alias() { ALIAS="upgrade"; } +step_10() { + exe cd $toolLoc + exe git pull + exe service $toolName restart +} + +VERSION_SEQREV=10 +. /usr/local/bin/sequencer.sh