Merge pull request #749 from tschettervictor/patch-1

Update destroy.sh - refuse to destroy jail with mounted filesystem
This commit is contained in:
Juan David Hurtado G
2025-01-06 17:39:06 -05:00
committed by GitHub

View File

@@ -54,6 +54,12 @@ destroy_jail() {
fi
if [ -d "${bastille_jail_base}" ]; then
## make sure no filesystem is currently mounted in the jail directory
mount_points=$(mount | cut -d ' ' -f 3 | grep "${bastille_jail_base}"/root/)
if [ -n "${mount_points}" ]; then
error_notify "Failed to destroy jail: ${TARGET}"
error_exit "Jail has mounted filesystems:\n$mount_points"
fi
info "Deleting Jail: ${TARGET}."
if checkyesno bastille_zfs_enable; then
if [ -n "${bastille_zfs_zpool}" ]; then