From 0dc07d62898b41ff47877fe292c8918c93a308d5 Mon Sep 17 00:00:00 2001 From: number201724 Date: Sun, 5 Nov 2023 16:31:12 +0800 Subject: [PATCH] Add support for FreeBSD --- src/zfs-auto-snapshot.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/zfs-auto-snapshot.sh b/src/zfs-auto-snapshot.sh index cd88f0f..29f690e 100644 --- a/src/zfs-auto-snapshot.sh +++ b/src/zfs-auto-snapshot.sh @@ -227,7 +227,11 @@ do_snapshots () # properties, flags, snapname, oldglob, [targets...] if [ "$(uname)" = "Darwin" ]; then GETOPT_BIN="$(brew --prefix gnu-getopt 2> /dev/null || echo /usr/local)/bin/getopt" else - GETOPT_BIN="getopt" + if [ "$(uname)" = "FreeBSD" ]; then + GETOPT_BIN="/usr/local/bin/getopt" + else + GETOPT_BIN="getopt" + fi fi GETOPT=$($GETOPT_BIN \