diff --git a/usr/local/share/bastille/cmd.sh b/usr/local/share/bastille/cmd.sh index 3d21f52e..263988ca 100644 --- a/usr/local/share/bastille/cmd.sh +++ b/usr/local/share/bastille/cmd.sh @@ -87,6 +87,7 @@ COUNT=0 RETURN=0 set_target "${TARGET}" +_last_jail="$(echo ${JAILS} | awk '{print $NF}')" for _jail in ${JAILS}; do @@ -116,6 +117,10 @@ for _jail in ${JAILS}; do else RETURN=$(($RETURN+$ERROR_CODE)) fi + + # Print blank line on last jail + [ "${_jail}" = "${_last_jail}" ] && echo "" + done # Check when a command is executed in all running jails. (bastille cmd ALL ...) diff --git a/usr/local/share/bastille/common.sh b/usr/local/share/bastille/common.sh index a5430a5a..5b53a2d6 100644 --- a/usr/local/share/bastille/common.sh +++ b/usr/local/share/bastille/common.sh @@ -67,6 +67,7 @@ fi # Notify message on error, and continue to next jail error_continue() { error_notify "$@" + echo "" # shellcheck disable=SC2104 continue } diff --git a/usr/local/share/bastille/console.sh b/usr/local/share/bastille/console.sh index 8539ec63..98f93001 100644 --- a/usr/local/share/bastille/console.sh +++ b/usr/local/share/bastille/console.sh @@ -84,6 +84,7 @@ USER="${2}" bastille_root_check set_target "${TARGET}" +_last_jail="$(echo ${JAILS} | awk '{print $NF}')" validate_user() { local _jail="${1}" @@ -133,5 +134,8 @@ for _jail in ${JAILS}; do LOGIN="$(jexec -l "${_jail}" which login)" ${_setfib} jexec -l "${_jail}" $LOGIN -f root fi + + # Print blank line on last jail + [ "${_jail}" = "${_last_jail}" ] && echo "" done diff --git a/usr/local/share/bastille/cp.sh b/usr/local/share/bastille/cp.sh index 41771ed6..7fdcd6cc 100644 --- a/usr/local/share/bastille/cp.sh +++ b/usr/local/share/bastille/cp.sh @@ -85,6 +85,7 @@ JAIL_PATH="${3}" bastille_root_check set_target "${TARGET}" +_last_jail="$(echo ${JAILS} | awk '{print $NF}')" for _jail in ${JAILS}; do @@ -98,4 +99,7 @@ for _jail in ${JAILS}; do error_continue "CP failed: ${host_path} -> ${jail_path}" fi + # Print blank line on last jail + [ "${_jail}" = "${_last_jail}" ] && echo "" + done \ No newline at end of file diff --git a/usr/local/share/bastille/destroy.sh b/usr/local/share/bastille/destroy.sh index 06392a7e..27d13a3b 100644 --- a/usr/local/share/bastille/destroy.sh +++ b/usr/local/share/bastille/destroy.sh @@ -110,6 +110,10 @@ destroy_jail() { pfctl -a "rdr/${_jail}" -Fn fi fi + + # Print blank line on last jail + [ "${_jail}" = "${_last_jail}" ] && echo "" + done } @@ -298,6 +302,7 @@ case "${TARGET}" in *) ## just destroy a jail set_target "${TARGET}" "reverse" + _last_jail="$(echo ${JAILS} | awk '{print $NF}')" destroy_jail "${JAILS}" ;; esac diff --git a/usr/local/share/bastille/jcp.sh b/usr/local/share/bastille/jcp.sh index bb10434b..ff50f0ad 100644 --- a/usr/local/share/bastille/jcp.sh +++ b/usr/local/share/bastille/jcp.sh @@ -87,6 +87,7 @@ DEST_PATH="${4}" bastille_root_check set_target_single "${SOURCE_TARGET}" && SOURCE_TARGET="${TARGET}" set_target "${DEST_TARGET}" && DEST_TARGET="${JAILS}" +_last_jail="$(echo ${JAILS} | awk '{print $NF}')" for _jail in ${DEST_TARGET}; do @@ -103,5 +104,9 @@ for _jail in ${DEST_TARGET}; do if ! cp "${OPTION}" "${source_path}" "${dest_path}"; then error_continue "JCP failed: ${source_path} -> ${dest_path}" fi + + # Print blank line on last jail + [ "${_jail}" = "${_last_jail}" ] && echo "" + fi done \ No newline at end of file diff --git a/usr/local/share/bastille/limits.sh b/usr/local/share/bastille/limits.sh index 7c1e0123..0bd89cb1 100644 --- a/usr/local/share/bastille/limits.sh +++ b/usr/local/share/bastille/limits.sh @@ -99,6 +99,7 @@ fi bastille_root_check set_target "${TARGET}" +_last_jail="$(echo ${JAILS} | awk '{print $NF}')" for _jail in ${JAILS}; do @@ -188,4 +189,8 @@ for _jail in ${JAILS}; do fi ;; esac + + # Print blank line on last jail + [ "${_jail}" = "${_last_jail}" ] && echo "" + done diff --git a/usr/local/share/bastille/mount.sh b/usr/local/share/bastille/mount.sh index 1352a776..d1676c28 100644 --- a/usr/local/share/bastille/mount.sh +++ b/usr/local/share/bastille/mount.sh @@ -90,6 +90,7 @@ fi bastille_root_check set_target "${TARGET}" +_last_jail="$(echo ${JAILS} | awk '{print $NF}')" # Assign variables _hostpath_fstab=$(echo "${_fstab}" | awk '{print $1}') @@ -198,4 +199,8 @@ for _jail in ${JAILS}; do echo "${_fstab_entry}" >> "${bastille_jailsdir}/${_jail}/fstab" || error_continue "Failed to create fstab entry: ${_fstab_entry}" mount -F "${bastille_jailsdir}/${_jail}/fstab" -a || error_continue "Failed to mount volume: ${_fullpath}" echo "Added: ${_fstab_entry}" + + # Print blank line on last jail + [ "${_jail}" = "${_last_jail}" ] && echo "" + done diff --git a/usr/local/share/bastille/pkg.sh b/usr/local/share/bastille/pkg.sh index f95ac81f..05f60db8 100644 --- a/usr/local/share/bastille/pkg.sh +++ b/usr/local/share/bastille/pkg.sh @@ -91,6 +91,7 @@ shift bastille_root_check set_target "${TARGET}" +_last_jail="$(echo ${JAILS} | awk '{print $NF}')" errors=0 @@ -124,6 +125,10 @@ for _jail in ${JAILS}; do errors=1 fi fi + + # Print blank line on last jail + [ "${_jail}" = "${_last_jail}" ] && echo "" + done if [ $errors -ne 0 ]; then diff --git a/usr/local/share/bastille/service.sh b/usr/local/share/bastille/service.sh index 4c58a0db..b29d66d7 100644 --- a/usr/local/share/bastille/service.sh +++ b/usr/local/share/bastille/service.sh @@ -84,6 +84,7 @@ shift bastille_root_check set_target "${TARGET}" +_last_jail="$(echo ${JAILS} | awk '{print $NF}')" for _jail in ${JAILS}; do @@ -99,4 +100,7 @@ for _jail in ${JAILS}; do jexec -l "${_jail}" /usr/sbin/service "$@" + # Print blank line on last jail + [ "${_jail}" = "${_last_jail}" ] && echo "" + done diff --git a/usr/local/share/bastille/start.sh b/usr/local/share/bastille/start.sh index ba2d7738..209a59a1 100644 --- a/usr/local/share/bastille/start.sh +++ b/usr/local/share/bastille/start.sh @@ -100,6 +100,7 @@ TARGET="${1}" bastille_root_check set_target "${TARGET}" +_last_jail="$(echo ${JAILS} | awk '{print $NF}')" for _jail in ${JAILS}; do @@ -187,5 +188,8 @@ for _jail in ${JAILS}; do # Delay between jail action sleep "${DELAY_TIME}" + + # Print blank line on last jail + [ "${_jail}" = "${_last_jail}" ] && echo "" done diff --git a/usr/local/share/bastille/stop.sh b/usr/local/share/bastille/stop.sh index 0d82c7f5..74643995 100644 --- a/usr/local/share/bastille/stop.sh +++ b/usr/local/share/bastille/stop.sh @@ -83,6 +83,7 @@ TARGET="${1}" bastille_root_check set_target "${TARGET}" "reverse" +_last_jail="$(echo ${JAILS} | awk '{print $NF}')" for _jail in ${JAILS}; do @@ -133,5 +134,8 @@ for _jail in ${JAILS}; do pfctl -q -t "${bastille_network_pf_table}" -T delete "${_ip}" done fi + + # Print blank line on last jail + [ "${_jail}" = "${_last_jail}" ] && echo "" done diff --git a/usr/local/share/bastille/sysrc.sh b/usr/local/share/bastille/sysrc.sh index b1e388d1..d25cb4fa 100644 --- a/usr/local/share/bastille/sysrc.sh +++ b/usr/local/share/bastille/sysrc.sh @@ -84,6 +84,7 @@ shift bastille_root_check set_target "${TARGET}" +_last_jail="$(echo ${JAILS} | awk '{print $NF}')" for _jail in ${JAILS}; do @@ -99,4 +100,7 @@ for _jail in ${JAILS}; do jexec -l "${_jail}" /usr/sbin/sysrc "$@" + # Print blank line on last jail + [ "${_jail}" = "${_last_jail}" ] && echo "" + done diff --git a/usr/local/share/bastille/tags.sh b/usr/local/share/bastille/tags.sh index 44258671..b753d50d 100644 --- a/usr/local/share/bastille/tags.sh +++ b/usr/local/share/bastille/tags.sh @@ -73,6 +73,7 @@ TAGS="${3}" bastille_root_check set_target "${TARGET}" +_last_jail="$(echo ${JAILS} | awk '{print $NF}')" for _jail in ${JAILS}; do @@ -118,5 +119,9 @@ for _jail in ${JAILS}; do usage ;; esac + + # Print blank line on last jail + [ "${_jail}" = "${_last_jail}" ] && echo "" + done diff --git a/usr/local/share/bastille/template.sh b/usr/local/share/bastille/template.sh index f3b988c9..5d0d76c0 100644 --- a/usr/local/share/bastille/template.sh +++ b/usr/local/share/bastille/template.sh @@ -221,6 +221,7 @@ if [ "${TARGET}" = '--convert' ]; then exit 0 else set_target "${TARGET}" + _last_jail="$(echo ${JAILS} | awk '{print $NF}')" fi case ${TEMPLATE} in @@ -469,6 +470,10 @@ for _jail in ${JAILS}; do echo fi done + + # Print blank line on last jail + [ "${_jail}" = "${_last_jail}" ] && echo "" + + info "Template applied: ${TEMPLATE}" - info "Template applied: ${TEMPLATE}" done diff --git a/usr/local/share/bastille/umount.sh b/usr/local/share/bastille/umount.sh index 8e9c604b..d569e731 100644 --- a/usr/local/share/bastille/umount.sh +++ b/usr/local/share/bastille/umount.sh @@ -84,6 +84,7 @@ MOUNT_PATH="${2}" bastille_root_check set_target "${TARGET}" +_last_jail="$(echo ${JAILS} | awk '{print $NF}')" for _jail in ${JAILS}; do @@ -126,4 +127,7 @@ for _jail in ${JAILS}; do echo "Unmounted: ${_jailpath}" + # Print blank line on last jail + [ "${_jail}" = "${_last_jail}" ] && echo "" + done diff --git a/usr/local/share/bastille/zfs.sh b/usr/local/share/bastille/zfs.sh index d3df3533..58d07793 100644 --- a/usr/local/share/bastille/zfs.sh +++ b/usr/local/share/bastille/zfs.sh @@ -52,6 +52,9 @@ for _jail in ${JAILS}; do # shellcheck disable=SC2140 zfs snapshot -r "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${_jail}"@"${TAG}" + # Print blank line on last jail + [ "${_jail}" = "${_last_jail}" ] && echo "" + done } @@ -64,6 +67,9 @@ for _jail in ${JAILS}; do # shellcheck disable=SC2140 zfs destroy -r "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${_jail}"@"${TAG}" + # Print blank line on last jail + [ "${_jail}" = "${_last_jail}" ] && echo "" + done } @@ -75,6 +81,9 @@ for _jail in ${JAILS}; do zfs "${ATTRIBUTE}" "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${_jail}" + # Print blank line on last jail + [ "${_jail}" = "${_last_jail}" ] && echo "" + done } @@ -85,6 +94,9 @@ for _jail in ${JAILS}; do info "[${_jail}]:" zfs get "${ATTRIBUTE}" "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${_jail}" + # Print blank line on last jail + [ "${_jail}" = "${_last_jail}" ] && echo "" + done } @@ -95,7 +107,10 @@ for _jail in ${JAILS}; do info "[${_jail}]:" zfs list -t all -o name,used,avail,refer,mountpoint,compress,ratio -r "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${_jail}" - + + # Print blank line on last jail + [ "${_jail}" = "${_last_jail}" ] && echo "" + done } @@ -129,6 +144,7 @@ ACTION="${2}" bastille_root_check set_target "${TARGET}" +_last_jail="$(echo ${JAILS} | awk '{print $NF}')" # Check if ZFS is enabled if ! checkyesno bastille_zfs_enable; then