From 4551d6c806dec69e4a4659d3cd07d7d8630f8bd3 Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Thu, 27 Feb 2025 17:09:20 -0700 Subject: [PATCH] upgrade: Exit if NEWREASE not found on thin jail upgrade --- usr/local/share/bastille/upgrade.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/usr/local/share/bastille/upgrade.sh b/usr/local/share/bastille/upgrade.sh index 7df54354..cfb66c27 100644 --- a/usr/local/share/bastille/upgrade.sh +++ b/usr/local/share/bastille/upgrade.sh @@ -134,6 +134,11 @@ jail_upgrade() { if grep -qw "${bastille_jailsdir}/${TARGET}/root/.bastille" "${bastille_jailsdir}/${TARGET}/fstab"; then local _oldrelease="$(grep osrelease ${bastille_jailsdir}/${TARGET}/jail.conf | awk -F"= " '{print $2}' | sed 's/;//g')" local _newrelease="${NEWRELEASE}" + # Exit if NEWRELEASE doesn't exist + if [ ! -d "${bastille_releasesdir}/${NEWRELEASE}" ]; then + error_notify "Release not found: ${NEWRELEASE}" + error_exit "See 'bastille bootstrap ${NEWRELEASE} to bootstrap the release." + fi # Update "osrelease" entry inside jail.conf sed -i '' "/.bastille/ s|${_oldrelease}|${_newrelease}|g" "${bastille_jailsdir}/${TARGET}/fstab" # Update "fstab" entry