diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 60443beade..31760b0566 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3373,18 +3373,24 @@ _EOF_" if To_Install 200 # DietPi-Dashboard then - # Stable release or nightly? - local version='Nightly' # Enforce nightly until 0.7.0 is released - #local version=$(sed -n '/^[[:blank:]]*SOFTWARE_DIETPI_DASHBOARD_VERSION=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) - #[[ $version == 'Nightly' ]] || version='Stable' - - #G_WHIP_MENU_ARRAY=( - # 'Stable' ': Use a release version of DietPi-Dashboard.' - # 'Nightly' ': Use an unstable version of DietPi-Dashboard.' - #) - #G_WHIP_DEFAULT_ITEM=$version - #G_WHIP_BUTTON_CANCEL_TEXT=$version - #G_WHIP_MENU 'Please choose which version of DietPi-Dashboard should be installed.' && version=$G_WHIP_RETURNED_VALUE + # Grab latest release + local release=$(curl -sSfL 'https://api.github.com/repos/nonnorm/dietpi-dashboard/releases/latest' | grep -Po '"tag_name": *"\K[^"]+') + + # Stable release or nightly choice, once v0.7.0 has been released + local version='Nightly' + if dpkg --compare-versions "${release#v}" ge 0.7.0 + then + version=$(sed -n '/^[[:blank:]]*SOFTWARE_DIETPI_DASHBOARD_VERSION=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + [[ $version == 'Nightly' ]] || version='Stable' + + G_WHIP_MENU_ARRAY=( + 'Stable' ': Use a release version of DietPi-Dashboard.' + 'Nightly' ': Use an unstable version of DietPi-Dashboard.' + ) + G_WHIP_DEFAULT_ITEM=$version + G_WHIP_BUTTON_CANCEL_TEXT=$version + G_WHIP_MENU 'Please choose which version of DietPi-Dashboard should be installed.' && version=$G_WHIP_RETURNED_VALUE + fi # Determine which components to install local components=('backend') @@ -3409,11 +3415,9 @@ _EOF_" Download_Install "https://nightly.link/nonnorm/DietPi-Dashboard/workflows/push-build/main/dietpi-dashboard-$G_HW_ARCH_NAME-$component.zip" /opt/dietpi-dashboard done else - # NB: Will not work until 0.7.0 is released - local manifest=$(curl -sSfL 'https://api.github.com/repos/nonnorm/dietpi-dashboard/releases/latest') for component in "${components[@]}" do - Download_Install "$(echo "$manifest" | grep -Po "\"browser_download_url\": *\"\K[^\"]*dietpi-dashboard-$G_HW_ARCH_NAME-$component")" /opt/dietpi-dashboard + Download_Install "https://github.com/nonnorm/DietPi-Dashboard/releases/download/$release/dietpi-dashboard-$G_HW_ARCH_NAME-$component" /opt/dietpi-dashboard done fi