From ba48ddc6ffdbca9f6a67cd2b69e195af32d44e7d Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Wed, 16 Dec 2015 02:04:22 +0000 Subject: [PATCH] early draft of update script --- init/30_update.sh | 19 +++++++++++++++++++ init/{30_set_config.sh => 40_set_config.sh} | 0 2 files changed, 19 insertions(+) create mode 100644 init/30_update.sh rename init/{30_set_config.sh => 40_set_config.sh} (100%) diff --git a/init/30_update.sh b/init/30_update.sh new file mode 100644 index 0000000..4393be4 --- /dev/null +++ b/init/30_update.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +jack_ver=$(curl -s https://api.github.com/repos/Jackett/Jackett/releases/latest | grep browser_download_url | grep Mono | cut -d '"' -f 4) +jackremote=$(echo $jack_ver | tr -d [=.=][:alpha:][=/=][=:=][:space:]) + +# get local versin +jacktest=$(mono /app/Jackett/JackettConsole.exe --version) +jackcut1=$(echo $jacktest | tr -d [=.=][:alpha:][:space:]) +jacklocal=${jackcut1%0} + +# test if we need to update +if [ "$jackremote" -gt "$jacklocal" ]; then +rm -rf /app/Jackett +curl -o /tmp/jacket.tar.gz -L $jack_ver +mkdir -p /app/Jackett +tar xvf /tmp/jacket.tar.gz -C /app/Jackett --strip-components=1 +fi + +chown -R abc:abc /app diff --git a/init/30_set_config.sh b/init/40_set_config.sh similarity index 100% rename from init/30_set_config.sh rename to init/40_set_config.sh