nextcloud/get_latest_version.sh

11 lines
383 B
Bash
Raw Normal View History

2024-06-29 14:20:16 +05:00
#!/bin/bash
# URL of the page containing the files
URL="https://download.nextcloud.com/server/releases/"
# Extract tar.bz2 file names and get the latest version number
latest_version=$(curl -s $URL | grep -oP 'nextcloud-\d+\.\d+\.\d+\.tar\.bz2' | sort -V | tail -1 | grep -oP '\d+\.\d+\.\d+')
# Print the latest version .tar.bz2 URL
echo ${URL}nextcloud-${latest_version}.tar.bz2