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