update_gotosocial.sh 652 B

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