Add a protection function against not disabling block cloning

Signed-off-by: magic_rb <magic_rb@redalder.org>
This commit is contained in:
magic_rb 2023-11-24 15:33:24 +01:00
parent 15908ba927
commit 1ee9ad4862

View file

@ -133,3 +133,19 @@ function yaml2nix()
nixfmt "${output_file}"
}
function zpool_warning()
{
if ! ( echo "$@" | grep -v create ) ; then
if [[ "$ZFS_I_REMEMBERED_TO_DISABLE_BLOCK_CLONING" == "1" ]] ; then
echo "I trust you, carry on! But be careful to disable block cloning..."
env zpool "$@"
else
echo "Disable block cloning or you will have a very bad time!"
fi
else
env zpool "$@"
fi
}
alias zpool="zpool_warning"