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