Explorar o código

Add update_gotosocial.sh

poesty hai 11 meses
pai
achega
a7c2c36214
Modificáronse 1 ficheiros con 13 adicións e 0 borrados
  1. 13 0
      update/update_gotosocial.sh

+ 13 - 0
update/update_gotosocial.sh

@@ -0,0 +1,13 @@
+#!/bin/bash
+current_version=v`/gotosocial/gotosocial -v | cut -d ' ' -f 3`
+latest_version=`curl -s https://api.github.com/repos/superseriousbusiness/gotosocial/releases/latest | grep 'tag_name' | cut -d '"' -f 4`
+if [ "$current_version" != "$latest_version" ]; then
+	systemctl stop gotosocial.service
+	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
+	tar -xvzf /tmp/gotosocial.tar.gz -C /gotosocial
+	rm /tmp/gotosocial.tar.gz
+	# user permissions or whatever
+	systemctl start gotosocial.service
+else
+	echo "Up-to-date"
+fi