update_alist.sh 351 B

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