From 863107588cf6dda30e958ab2df9fca1341b9dadd Mon Sep 17 00:00:00 2001 From: Antynea Date: Wed, 22 Sep 2021 15:40:05 +0200 Subject: [PATCH] Remove redundant check Running a command and then checking its exit status $? against 0 is redundant. Instead of just checking the exit code of a command, it checks the exit code of a command that checks the exit code of a command. --- 41_snapshots-btrfs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/41_snapshots-btrfs b/41_snapshots-btrfs index 98faf2d..239bd1e 100755 --- a/41_snapshots-btrfs +++ b/41_snapshots-btrfs @@ -245,8 +245,7 @@ trim() { snapshot_list() { # Query info from snapper if it is installed - type snapper >/dev/null 2>&1 - if [ $? -eq 0 ]; then + if type snapper >/dev/null 2>&1; then if [ -s "/etc/snapper/configs/$snapper_config" ]; then printf "Info: snapper detected, using config '$snapper_config'\n" >&2 local snapper_ids=($(snapper --no-dbus -t 0 -c "$snapper_config" list --disable-used-space | tail -n +3 | cut -d'|' -f 1))