early draft of update script

This commit is contained in:
sparklyballs 2015-12-16 02:04:22 +00:00
parent 736402b56f
commit ba48ddc6ff
2 changed files with 19 additions and 0 deletions

19
init/30_update.sh Normal file
View File

@ -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