Skip to content

Instantly share code, notes, and snippets.

@Domin8-IPTV
Last active February 18, 2020 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Domin8-IPTV/075a00d57541c0e9c28071becc92af6a to your computer and use it in GitHub Desktop.
Save Domin8-IPTV/075a00d57541c0e9c28071becc92af6a to your computer and use it in GitHub Desktop.
EMBY Update
#!/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