mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-25 09:36:14 +01:00
Add a protection function against not disabling block cloning
Signed-off-by: magic_rb <magic_rb@redalder.org>
This commit is contained in:
parent
15908ba927
commit
1ee9ad4862
|
@ -133,3 +133,19 @@ function yaml2nix()
|
||||||
|
|
||||||
nixfmt "${output_file}"
|
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"
|
||||||
|
|
Loading…
Reference in a new issue