Automatically find the latest released version of opencloud

This commit is contained in:
Klaas Freitag
2025-04-16 18:32:11 +02:00
parent 386807dae8
commit f31bdb08cf

View File

@@ -34,10 +34,18 @@ function backup_file () {
fi
}
function get_latest_version() {
latest_version=`curl --silent "https://api.github.com/repos/opencloud-eu/opencloud/releases/latest" \
| jq -r .tag_name \
| sed -e s/^v//`
}
# URL pattern of the download file
# https://github.com/opencloud-eu/opencloud/releases/download/v1.0.0/opencloud-1.0.0-linux-amd64
dlversion="${OC_VERSION:-2.0.0}"
get_latest_version
dlversion="${OC_VERSION:-$latest_version}"
dlurl="https://github.com/opencloud-eu/opencloud/releases/download/v${dlversion}/"
sandbox="opencloud-sandbox-${dlversion}"