json encode now

This commit is contained in:
Shihaam Abdul Rahman 2024-06-29 18:34:44 +05:00
parent 8801475079
commit 7fb228d60b
Signed by: shihaam
GPG Key ID: 6DA2E87EBC227636

View File

@ -6,5 +6,5 @@ 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
# json encode and print the version, download url and filename
echo "{\"version\":\"${latest_version}\",\"url\":\"${URL}nextcloud-${latest_version}.tar.bz2\",\"filename\":\"nextcloud-${latest_version}.tar.bz2\"}"