Last active
February 18, 2020 21:19
-
-
Save Domin8-IPTV/075a00d57541c0e9c28071becc92af6a to your computer and use it in GitHub Desktop.
EMBY Update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
packageName="emby-server" | |
packageURL="https://api.github.com/repos/MediaBrowser/Emby/releases/latest" | |
tmp="/tmp" | |
latestVersionURL=$(curl -s "$packageURL" | jq -r ".assets[] | select(.name | test(\"amd64\")) | .browser_download_url" |grep -v netgear) | |
fileName=$(basename -s .deb $latestVersionURL) | |
lastInstalled=$(dpkg -s $packageName |grep '^Version' | awk '{print $2}') | |
getFile () { | |
echo "Downloading "$fileName"" & curl -L $latestVersionURL -o $tmp/$fileName 2>/dev/null | |
if [[ "$?" = "0" ]]; then dpkg -i $tmp/$fileName; else exit 2; fi ; } | |
case "$latestVersionURL" in | |
*_${lastInstalled}_*) echo "Emby is current." & exit ;; | |
*) getFile ;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment