From f3619cd8c3108e0649e142e1fbe534db00577036 Mon Sep 17 00:00:00 2001 From: Kuba Marek Date: Thu, 23 Apr 2020 20:39:12 +0200 Subject: [PATCH] Accept on and off as well as true and false in zfs command outputs --- src/zfs-auto-snapshot.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/zfs-auto-snapshot.sh b/src/zfs-auto-snapshot.sh index cd88f0f..3bc252c 100644 --- a/src/zfs-auto-snapshot.sh +++ b/src/zfs-auto-snapshot.sh @@ -453,7 +453,7 @@ ZPOOLS_NOTREADY=$(echo "$ZPOOL_STATUS" | awk -F ': ' \ # Get a list of datasets for which snapshots are explicitly disabled. NOAUTO=$(echo "$ZFS_LIST" | awk -F '\t' \ - 'tolower($2) ~ /false/ || tolower($3) ~ /false/ {print $1}') + 'tolower($2) ~ /false|off/ || tolower($3) ~ /false|off/ {print $1}') # If the --default-exclude flag is set, then exclude all datasets that lack # an explicit com.sun:auto-snapshot* property. Otherwise, include them. @@ -461,11 +461,11 @@ if [ -n "$opt_default_exclude" ] then # Get a list of datasets for which snapshots are explicitly enabled. CANDIDATES=$(echo "$ZFS_LIST" | awk -F '\t' \ - 'tolower($2) ~ /true/ || tolower($3) ~ /true/ {print $1}') + 'tolower($2) ~ /true|on/ || tolower($3) ~ /true|on/ {print $1}') else # Invert the NOAUTO list. CANDIDATES=$(echo "$ZFS_LIST" | awk -F '\t' \ - 'tolower($2) !~ /false/ && tolower($3) !~ /false/ {print $1}') + 'tolower($2) !~ /false|off/ && tolower($3) !~ /false|off/ {print $1}') fi # Initialize the list of datasets that will get a recursive snapshot.