From 0b438f91ba2f8792ac6b85ca830b8fb31db0bcff Mon Sep 17 00:00:00 2001 From: PedoDeveloper Date: Mon, 11 Nov 2024 13:03:48 +0000 Subject: [PATCH] Minor code cleanup --- modules/archive.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/modules/archive.sh b/modules/archive.sh index 330bcc9..aa40b1c 100755 --- a/modules/archive.sh +++ b/modules/archive.sh @@ -30,14 +30,10 @@ check_input() { if [[ ! -e "${input_file}" ]]; then echo "ERROR: Input file '${input_file}' does not exist" exit 2 - fi - - if [[ -z "${archive_pwd}" ]]; then + elif [[ -z "${archive_pwd}" ]]; then echo "ERROR: No password given" exit 2 - fi - - if ! [[ "$size" =~ ^([1-9][0-9]*)?$ ]]; then + elif [[ ! "$size" =~ ^([1-9][0-9]*)?$ ]]; then echo "Invalid size $size, must be empty or a positive number" exit 2 fi