adjust blank line option

This commit is contained in:
tschettervictor
2025-04-30 08:19:50 -06:00
parent af24e764bc
commit bef2ece965
23 changed files with 100 additions and 75 deletions

View File

@@ -147,7 +147,7 @@ for _jail in ${JAILS}; do
else
info "[${_jail}]:"
error_notify "Jail is not running."
error_exit "Use [-a|--auto] to auto-start the jail."
error_continue_next_jail "Use [-a|--auto] to auto-start the jail."
fi
info "[${_jail}]:"
@@ -167,13 +167,13 @@ for _jail in ${JAILS}; do
# Create mount point if it does not exist
if [ -d "${_hostpath}" ] && [ ! -d "${_fullpath}" ]; then
mkdir -p "${_fullpath}" || error_continue "Failed to create mount point."
mkdir -p "${_fullpath}" || error_continue_next_jail "Failed to create mount point."
elif [ -f "${_hostpath}" ] ; then
_filename="$( basename ${_hostpath} )"
if echo "${_fullpath}" 2>/dev/null | grep -qow "${_filename}"; then
mkdir -p "$( dirname "${_fullpath}" )" || error_continue "Failed to create mount point."
mkdir -p "$( dirname "${_fullpath}" )" || error_continue_next_jail "Failed to create mount point."
if [ ! -f "${_fullpath}" ]; then
touch "${_fullpath}" || error_continue "Failed to create mount point."
touch "${_fullpath}" || error_continue_next_jail "Failed to create mount point."
else
error_notify "Failed. File exists at mount point."
warn "${_fullpath}"
@@ -183,9 +183,9 @@ for _jail in ${JAILS}; do
_fullpath_fstab="$( echo "${bastille_jailsdir}/${_jail}/root/${_jailpath_fstab}/${_filename}" 2>/dev/null | sed 's#//#/#' )"
_fullpath="$( echo "${bastille_jailsdir}/${_jail}/root/${_jailpath}/${_filename}" 2>/dev/null | sed 's#//#/#' )"
_fstab_entry="${_hostpath_fstab} ${_fullpath_fstab} ${_type} ${_perms} ${_checks}"
mkdir -p "$( dirname "${_fullpath}" )" || error_continue "Failed to create mount point."
mkdir -p "$( dirname "${_fullpath}" )" || error_continue_next_jail "Failed to create mount point."
if [ ! -f "${_fullpath}" ]; then
touch "${_fullpath}" || error_continue "Failed to create mount point."
touch "${_fullpath}" || error_continue_next_jail "Failed to create mount point."
else
error_notify "Failed. File exists at mount point."
warn "${_fullpath}"
@@ -195,11 +195,11 @@ for _jail in ${JAILS}; do
fi
# Add entry to fstab and mount
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 "${_fstab_entry}" >> "${bastille_jailsdir}/${_jail}/fstab" || error_continue_next_jail "Failed to create fstab entry: ${_fstab_entry}"
mount -F "${bastille_jailsdir}/${_jail}/fstab" -a || error_continue_next_jail "Failed to mount volume: ${_fullpath}"
echo "Added: ${_fstab_entry}"
# Print blank line
echo ""
echo
done