diff --git a/usr/local/share/bastille/cmd.sh b/usr/local/share/bastille/cmd.sh index c48e848c..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 @@ -118,7 +119,6 @@ for _jail in ${JAILS}; do fi # Print blank line on last jail - _last_jail="$(echo ${JAILS} | awk '{print $NF}')" [ "${_jail}" = "${_last_jail}" ] && echo "" done diff --git a/usr/local/share/bastille/console.sh b/usr/local/share/bastille/console.sh index d3a98e21..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}" @@ -135,7 +136,6 @@ for _jail in ${JAILS}; do fi # Print blank line on last jail - _last_jail="$(echo ${JAILS} | awk '{print $NF}')" [ "${_jail}" = "${_last_jail}" ] && echo "" done diff --git a/usr/local/share/bastille/cp.sh b/usr/local/share/bastille/cp.sh index 40dabca3..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 @@ -99,7 +100,6 @@ for _jail in ${JAILS}; do fi # Print blank line on last jail - _last_jail="$(echo ${JAILS} | awk '{print $NF}')" [ "${_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 23d5f2ac..27d13a3b 100644 --- a/usr/local/share/bastille/destroy.sh +++ b/usr/local/share/bastille/destroy.sh @@ -112,7 +112,6 @@ destroy_jail() { fi # Print blank line on last jail - _last_jail="$(echo ${JAILS} | awk '{print $NF}')" [ "${_jail}" = "${_last_jail}" ] && echo "" done @@ -303,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 ba4b060a..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 @@ -105,7 +106,6 @@ for _jail in ${DEST_TARGET}; do fi # Print blank line on last jail - _last_jail="$(echo ${JAILS} | awk '{print $NF}')" [ "${_jail}" = "${_last_jail}" ] && echo "" fi diff --git a/usr/local/share/bastille/limits.sh b/usr/local/share/bastille/limits.sh index 64820bdc..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 @@ -190,7 +191,6 @@ for _jail in ${JAILS}; do esac # Print blank line on last jail - _last_jail="$(echo ${JAILS} | awk '{print $NF}')" [ "${_jail}" = "${_last_jail}" ] && echo "" done diff --git a/usr/local/share/bastille/mount.sh b/usr/local/share/bastille/mount.sh index 26034725..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}') @@ -200,7 +201,6 @@ for _jail in ${JAILS}; do echo "Added: ${_fstab_entry}" # Print blank line on last jail - _last_jail="$(echo ${JAILS} | awk '{print $NF}')" [ "${_jail}" = "${_last_jail}" ] && echo "" done diff --git a/usr/local/share/bastille/pkg.sh b/usr/local/share/bastille/pkg.sh index bbce79a6..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 @@ -126,7 +127,6 @@ for _jail in ${JAILS}; do fi # Print blank line on last jail - _last_jail="$(echo ${JAILS} | awk '{print $NF}')" [ "${_jail}" = "${_last_jail}" ] && echo "" done diff --git a/usr/local/share/bastille/service.sh b/usr/local/share/bastille/service.sh index 3ca6e63a..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 @@ -100,7 +101,6 @@ for _jail in ${JAILS}; do jexec -l "${_jail}" /usr/sbin/service "$@" # Print blank line on last jail - _last_jail="$(echo ${JAILS} | awk '{print $NF}')" [ "${_jail}" = "${_last_jail}" ] && echo "" done diff --git a/usr/local/share/bastille/start.sh b/usr/local/share/bastille/start.sh index 5204e057..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 @@ -189,7 +190,6 @@ for _jail in ${JAILS}; do sleep "${DELAY_TIME}" # Print blank line on last jail - _last_jail="$(echo ${JAILS} | awk '{print $NF}')" [ "${_jail}" = "${_last_jail}" ] && echo "" done diff --git a/usr/local/share/bastille/stop.sh b/usr/local/share/bastille/stop.sh index 3e8bce75..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 @@ -135,7 +136,6 @@ for _jail in ${JAILS}; do fi # Print blank line on last jail - _last_jail="$(echo ${JAILS} | awk '{print $NF}')" [ "${_jail}" = "${_last_jail}" ] && echo "" done diff --git a/usr/local/share/bastille/sysrc.sh b/usr/local/share/bastille/sysrc.sh index a34feca9..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 @@ -100,7 +101,6 @@ for _jail in ${JAILS}; do jexec -l "${_jail}" /usr/sbin/sysrc "$@" # Print blank line on last jail - _last_jail="$(echo ${JAILS} | awk '{print $NF}')" [ "${_jail}" = "${_last_jail}" ] && echo "" done diff --git a/usr/local/share/bastille/tags.sh b/usr/local/share/bastille/tags.sh index 81e8f77d..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 @@ -120,7 +121,6 @@ for _jail in ${JAILS}; do esac # Print blank line on last jail - _last_jail="$(echo ${JAILS} | awk '{print $NF}')" [ "${_jail}" = "${_last_jail}" ] && echo "" done diff --git a/usr/local/share/bastille/template.sh b/usr/local/share/bastille/template.sh index 14409733..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 @@ -471,7 +472,6 @@ for _jail in ${JAILS}; do done # Print blank line on last jail - _last_jail="$(echo ${JAILS} | awk '{print $NF}')" [ "${_jail}" = "${_last_jail}" ] && echo "" info "Template applied: ${TEMPLATE}" diff --git a/usr/local/share/bastille/umount.sh b/usr/local/share/bastille/umount.sh index c8395ed8..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 @@ -127,7 +128,6 @@ for _jail in ${JAILS}; do echo "Unmounted: ${_jailpath}" # Print blank line on last jail - _last_jail="$(echo ${JAILS} | awk '{print $NF}')" [ "${_jail}" = "${_last_jail}" ] && echo "" done diff --git a/usr/local/share/bastille/zfs.sh b/usr/local/share/bastille/zfs.sh index 70209928..58d07793 100644 --- a/usr/local/share/bastille/zfs.sh +++ b/usr/local/share/bastille/zfs.sh @@ -53,7 +53,6 @@ for _jail in ${JAILS}; do zfs snapshot -r "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${_jail}"@"${TAG}" # Print blank line on last jail - _last_jail="$(echo ${JAILS} | awk '{print $NF}')" [ "${_jail}" = "${_last_jail}" ] && echo "" done @@ -69,7 +68,6 @@ for _jail in ${JAILS}; do zfs destroy -r "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${_jail}"@"${TAG}" # Print blank line on last jail - _last_jail="$(echo ${JAILS} | awk '{print $NF}')" [ "${_jail}" = "${_last_jail}" ] && echo "" done @@ -84,7 +82,6 @@ for _jail in ${JAILS}; do zfs "${ATTRIBUTE}" "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${_jail}" # Print blank line on last jail - _last_jail="$(echo ${JAILS} | awk '{print $NF}')" [ "${_jail}" = "${_last_jail}" ] && echo "" done @@ -98,7 +95,6 @@ for _jail in ${JAILS}; do zfs get "${ATTRIBUTE}" "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${_jail}" # Print blank line on last jail - _last_jail="$(echo ${JAILS} | awk '{print $NF}')" [ "${_jail}" = "${_last_jail}" ] && echo "" done @@ -113,7 +109,6 @@ for _jail in ${JAILS}; do 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 - _last_jail="$(echo ${JAILS} | awk '{print $NF}')" [ "${_jail}" = "${_last_jail}" ] && echo "" done @@ -149,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