commit 5f3b6baa52b8dfb219c5767d2a59e61091383000 parent ddd089b5680f78e76aab4ea29c2b15f8c0ac0f75 Author: William Casarin <jb55@jb55.com> Date: Wed, 4 Nov 2020 11:28:49 -0800 arcsize: return 0 for non-zfs systems like my laptop Diffstat:
M | bin/arcsize | | | 5 | +++++ |
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/bin/arcsize b/bin/arcsize @@ -1,2 +1,7 @@ #!/usr/bin/env sh +if [ ! -f /proc/spl/kstat/zfs/arcstats ] +then + echo 0 + exit 0 +fi cat /proc/spl/kstat/zfs/arcstats | grep -E ^size | awk '{print $3}'