From 65b6887712066c6a43aaaab7e2f40e1f43cf3001 Mon Sep 17 00:00:00 2001 From: home Date: Tue, 28 Nov 2023 02:55:05 +0300 Subject: [PATCH] checksum : return error when there are no targets. --- .config/bash/module/checksum.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.config/bash/module/checksum.sh b/.config/bash/module/checksum.sh index d6d810b..ed5c738 100644 --- a/.config/bash/module/checksum.sh +++ b/.config/bash/module/checksum.sh @@ -40,8 +40,10 @@ checksum_create() if [[ ${failed} != 0 ]]; then echo -e "${color_bred}Failed: ${failed}.${color_default}" - false + return 1 fi + + [[ ${total} = 0 ]] && return 1 } # Check stored values against actual files. @@ -86,13 +88,15 @@ checksum_check() if [[ ${skipped} != 0 ]]; then echo -e "${color_byellow}Skipped: ${skipped}.${color_default}" - false + return 1 fi if [[ ${failed} != 0 ]]; then echo -e "${color_bred}Failed: ${failed}.${color_default}" - false + return 1 fi + + [[ ${total} = 0 ]] && return 1 } checksum()