From bb39b10719956e7080aa8f715299312be40b885e Mon Sep 17 00:00:00 2001 From: sts23 <53382325+sts23@users.noreply.github.com> Date: Sat, 2 Jan 2021 01:54:00 +0100 Subject: [PATCH] Update sts23.sh Freebsd kompatibler zfs list aufruf --- sts23.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sts23.sh b/sts23.sh index 2249147..1264ba4 100644 --- a/sts23.sh +++ b/sts23.sh @@ -16,9 +16,9 @@ FILTER="$2" # Wieviele behalten BEHALTE="$3" -[ $BEHALTE -gt 0 ] 2>/dev/null +[ $BEHALTE -ge 0 ] 2>/dev/null if [ "$?" != "0" ] -then +then echo "Parameter 3 keine pos. Zahl" echo "$AUFRUF" exit 0 @@ -40,9 +40,9 @@ do if [ "$MUSTER" = "" ] then - SNAPS=$(zfs list -t snap -H -o name -s creation "${DATASET}") + SNAPS=$(zfs list -r -t snap -H -o name -s creation|grep "${DATASET}@") else - SNAPS=$(zfs list -t snap -H -o name -s creation "${DATASET}"|grep $MUSTER) + SNAPS=$(zfs list -r -t snap -H -o name -s creation|grep "${DATASET}@"|grep $MUSTER) fi ANZSNAPS=$(echo $SNAPS|wc -w) @@ -77,9 +77,9 @@ do echo "# Liste nach zfs destroy" if [ "$MUSTER" = "" ] then - zfs list -t snap -o name -s creation "${DATASET}" + zfs list -r -t snap -o name -s creation|grep "${DATASET}@" else - zfs list -t snap -o name -s creation "${DATASET}"|grep $MUSTER + zfs list -r -t snap -o name -s creation|grep "${DATASET}@"|grep $MUSTER fi else echo "# Test - folgende zfs destroys würden ausgführt"