- #!/bin/bash
- current_version=`/opt/slskd/slskd -v | cut -d '+' -f 1`
- latest_version=`curl -s https://api.github.com/repos/slskd/slskd/releases/latest | grep 'tag_name' | cut -d '"' -f 4`
- if [[ $current_version =~ $latest_version ]]; then
- echo "Up-to-date"
- else
- systemctl stop slskd.service
- wget `curl -s https://api.github.com/repos/slskd/slskd/releases/latest | grep 'browser_download_url.*linux-x64' | cut -d '"' -f 4` -O /tmp/slskd.zip
- unzip -o /tmp/slskd.zip -d /opt/slskd
- rm /tmp/slskd.zip
- # user permissions or whatever
- systemctl start slskd.service
- fi
|