diff --git a/usr/local/share/bastille/destroy.sh b/usr/local/share/bastille/destroy.sh index f6aabc99..5eff79ff 100644 --- a/usr/local/share/bastille/destroy.sh +++ b/usr/local/share/bastille/destroy.sh @@ -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