Fix to properly upgrade base releases
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# Copyright (c) 2018-2020, Christer Edwards <christer.edwards@gmail.com>
|
# Copyright (c) 2018-2021, Christer Edwards <christer.edwards@gmail.com>
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@@ -91,7 +91,9 @@ release_upgrade() {
|
|||||||
# Upgrade a release
|
# Upgrade a release
|
||||||
if [ -d "${bastille_releasesdir}/${TARGET}" ]; then
|
if [ -d "${bastille_releasesdir}/${TARGET}" ]; then
|
||||||
release_check
|
release_check
|
||||||
freebsd-update ${OPTION} -b "${bastille_releasesdir}/${TARGET}" -r "${NEWRELEASE}" upgrade
|
env PAGER="/bin/cat" freebsd-update ${OPTION} --not-running-from-cron -b "${bastille_releasesdir}/${TARGET}" --currently-running "${TARGET}" -r "${NEWRELEASE}" upgrade
|
||||||
|
echo
|
||||||
|
echo -e "${COLOR_YELLOW}Please run 'bastille upgrade ${TARGET} install' to finish installing updates.${COLOR_RESET}"
|
||||||
else
|
else
|
||||||
error_exit "${TARGET} not found. See 'bastille bootstrap'."
|
error_exit "${TARGET} not found. See 'bastille bootstrap'."
|
||||||
fi
|
fi
|
||||||
@@ -121,9 +123,22 @@ jail_updates_install() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
release_updates_install() {
|
||||||
|
# Finish installing upgrade on a release
|
||||||
|
if [ -d "${bastille_releasesdir}/${TARGET}" ]; then
|
||||||
|
env PAGER="/bin/cat" freebsd-update ${OPTION} --not-running-from-cron -b "${bastille_releasesdir}/${TARGET}" install
|
||||||
|
else
|
||||||
|
error_exit "${TARGET} not found. See 'bastille bootstrap'."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Check what we should upgrade
|
# Check what we should upgrade
|
||||||
if echo "${TARGET}" | grep -q "[0-9]\{2\}.[0-9]-RELEASE"; then
|
if echo "${TARGET}" | grep -q "[0-9]\{2\}.[0-9]-RELEASE"; then
|
||||||
release_upgrade
|
if [ "${NEWRELEASE}" = "install" ]; then
|
||||||
|
release_updates_install
|
||||||
|
else
|
||||||
|
release_upgrade
|
||||||
|
fi
|
||||||
elif [ "${NEWRELEASE}" = "install" ]; then
|
elif [ "${NEWRELEASE}" = "install" ]; then
|
||||||
jail_updates_install
|
jail_updates_install
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user