update_navidrome.sh 628 B

12345678910111213
  1. #!/bin/bash
  2. current_version=v`/opt/navidrome/navidrome -v | cut -d ' ' -f 1`
  3. latest_version=`curl -s https://api.github.com/repos/navidrome/navidrome/releases/latest | grep 'tag_name' | cut -d '"' -f 4`
  4. if [ "$current_version" != "$latest_version" ]; then
  5. systemctl stop navidrome.service
  6. wget `curl -s https://api.github.com/repos/navidrome/navidrome/releases/latest | grep 'browser_download_url.*linux_amd64' | cut -d '"' -f 4` -O /tmp/Navidrome.tar.gz
  7. tar -xvzf /tmp/Navidrome.tar.gz -C /opt/navidrome/
  8. rm /tmp/Navidrome.tar.gz
  9. # user permissions or whatever
  10. systemctl start navidrome.service
  11. else
  12. echo "Up-to-date"
  13. fi