From 547d01009e6d282fa298bc1e5550087c79cab2c0 Mon Sep 17 00:00:00 2001 From: Dave Eddy Date: Sat, 4 Dec 2021 12:31:09 -0500 Subject: [PATCH] put binary check below argument parsing --- zfs-prune-snapshots | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/zfs-prune-snapshots b/zfs-prune-snapshots index 1b582e0..2d29e41 100755 --- a/zfs-prune-snapshots +++ b/zfs-prune-snapshots @@ -165,11 +165,6 @@ human-size() { echo '0 B' } -if ! command -v zfs &>/dev/null; then - echo "Error! zfs command not found. Are you on the right machine?" >&2 - exit 1 -fi - recursive=false dryrun=false listonly=false @@ -240,6 +235,11 @@ if ! now=$(get-epoch); then exit 1 fi +if ! command -v zfs &>/dev/null; then + echo "Error! zfs command not found. Are you on the right machine?" >&2 + exit 1 +fi + # first pass of the pools (to calculate totals and filter unwanted datasets lines=() while read -r line; do