Update destroy.sh - allow for jail root to be mounted when destroying

This will allow the jail root to be mounted when destroying a jail, but if anything under 'root' is still mounted, it will exit.
This commit is contained in:
tschettervictor
2024-11-24 17:45:49 -07:00
committed by GitHub
parent ab56fb5761
commit 09808b70dd

View File

@@ -55,7 +55,7 @@ destroy_jail() {
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}")
mount_points=$(mount | cut -d ' ' -f 3 | grep "${bastille_jail_base}"/root/)
if [ $? -eq 0 ]; then
error_notify "Failed to destroy jail: ${TARGET}"
error_exit "Jail has mounted filesystems:\n$mount_points"