소스 검색

Add update_alist.sh

poesty 1 년 전
부모
커밋
df3ec7a278
2개의 변경된 파일10개의 추가작업 그리고 2개의 파일을 삭제
  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