mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-25 15:00:44 +01:00
User option to force destroy jail in ZFS
This commit is contained in:
@@ -60,8 +60,12 @@ destroy_jail() {
|
||||
if [ "${bastille_zfs_enable}" = "YES" ]; then
|
||||
if [ -n "${bastille_zfs_zpool}" ]; then
|
||||
if [ -n "${TARGET}" ]; then
|
||||
local OPTIONS="-r"
|
||||
if [ "${FORCE}" = "1" ]; then
|
||||
local OPTIONS="-rf"
|
||||
fi
|
||||
## remove jail zfs dataset recursively
|
||||
zfs destroy -r "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${TARGET}"
|
||||
zfs destroy "${OPTIONS}" "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${TARGET}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user