Explorar o código

Add update_alist.sh

poesty hai 1 ano
pai
achega
df3ec7a278
Modificáronse 2 ficheiros con 10 adicións e 2 borrados
  1. 8 0
      update/update_alist.sh
  2. 2 2
      update/update_miniflux.sh

+ 8 - 0
update/update_alist.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+current_version=`/opt/alist/alist version | grep 'Version: v' | cut -d ' ' -f 2`
+latest_version=`curl -s https://api.github.com/repos/alist-org/alist/releases/latest | grep 'tag_name' | cut -d '"' -f 4`
+if [ "$current_version" != "$latest_version" ]; then
+	curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s update
+else
+	echo "Up-to-date"
+fi

+ 2 - 2
update/update_miniflux.sh

@@ -1,7 +1,7 @@
 #!/bin/bash
 export DATABASE_URL=""
 ./miniflux -flush-sessions
-wget `curl -s https://api.github.com/repos/miniflux/v2/releases | grep 'browser_download_url.*miniflux-linux-amd64' | head -n 1 | cut -d '"' -f 4`
+wget `curl -s https://api.github.com/repos/miniflux/v2/releases/latest | grep 'browser_download_url.*miniflux-linux-amd64' | cut -d '"' -f 4`
 mv miniflux-linux-amd64 miniflux
 chmod +x miniflux
-./miniflux -migrate
+./miniflux -migrate