mirror of
https://github.com/hackacad/bastille.git
synced 2026-01-04 03:33:41 +01:00
Add \n to info _jail
This commit is contained in:
@@ -107,15 +107,20 @@ arch_check() {
|
||||
}
|
||||
|
||||
jail_check() {
|
||||
|
||||
# Check if the jail is thick and is running
|
||||
set_target_single "${TARGET}"
|
||||
|
||||
check_target_is_running "${TARGET}" || if [ "${AUTO}" -eq 1 ]; then
|
||||
echo "Auto-starting ${TARGET}..."
|
||||
bastille start "${TARGET}"
|
||||
else
|
||||
info "\n[${TARGET}]:"
|
||||
error_notify "Jail is not running."
|
||||
error_exit "Use [-a|--auto] to auto-start the jail."
|
||||
fi
|
||||
|
||||
info "\n[${TARGET}]:"
|
||||
|
||||
if grep -qw "${bastille_jailsdir}/${TARGET}/root/.bastille" "${bastille_jailsdir}/${TARGET}/fstab"; then
|
||||
error_notify "${TARGET} is not a thick container."
|
||||
error_exit "See 'bastille update RELEASE' to update thin jails."
|
||||
@@ -123,10 +128,12 @@ jail_check() {
|
||||
}
|
||||
|
||||
jail_update() {
|
||||
|
||||
local _jailname="${1}"
|
||||
local _jailpath="${bastille_jailsdir}/${TARGET}/root"
|
||||
local _freebsd_update_conf="${_jailpath}/etc/freebsd-update.conf"
|
||||
local _workdir="${_jailpath}/var/db/freebsd-update"
|
||||
|
||||
# Update a thick container
|
||||
if [ -d "${bastille_jailsdir}/${TARGET}" ]; then
|
||||
CURRENT_VERSION=$(/usr/sbin/jexec -l "${TARGET}" freebsd-version 2>/dev/null)
|
||||
@@ -144,9 +151,11 @@ jail_update() {
|
||||
}
|
||||
|
||||
release_update() {
|
||||
|
||||
local _releasepath="${bastille_releasesdir}/${TARGET}"
|
||||
local _freebsd_update_conf="${_releasepath}/etc/freebsd-update.conf"
|
||||
local _workdir="${_releasepath}/var/db/freebsd-update"
|
||||
|
||||
# Update a release base(affects child containers)
|
||||
if [ -d "${_releasepath}" ]; then
|
||||
TARGET_TRIM="${TARGET}"
|
||||
@@ -171,8 +180,10 @@ release_update() {
|
||||
}
|
||||
|
||||
template_update() {
|
||||
|
||||
# Update a template
|
||||
_template_path=${bastille_templatesdir}/${BASTILLE_TEMPLATE}
|
||||
|
||||
if [ -d $_template_path ]; then
|
||||
info "[${BASTILLE_TEMPLATE}]:"
|
||||
git -C $_template_path pull ||\
|
||||
@@ -185,6 +196,7 @@ template_update() {
|
||||
}
|
||||
|
||||
templates_update() {
|
||||
|
||||
# Update all templates
|
||||
_updated_templates=0
|
||||
if [ -d ${bastille_templatesdir} ]; then
|
||||
@@ -216,9 +228,6 @@ elif echo "${TARGET}" | grep -q "[0-9]\{2\}.[0-9]-RELEASE"; then
|
||||
arch_check
|
||||
release_update
|
||||
else
|
||||
info "\n[${TARGET}]:"
|
||||
jail_check
|
||||
jail_update "${TARGET}"
|
||||
fi
|
||||
|
||||
echo
|
||||
fi
|
||||
Reference in New Issue
Block a user