diff --git a/modules/archive.sh b/modules/archive.sh index d9ea711..7c3196b 100755 --- a/modules/archive.sh +++ b/modules/archive.sh @@ -19,11 +19,7 @@ check_input() { [[ -e "$input_file" ]] || { log "ERROR" "Input file '${input_file}' does not exist"; exit 2; } [[ -n "${password}" ]] || { log "ERROR" "No password given"; exit 2; } - - if [[ ! "$size" =~ ^([1-9][0-9]*)?$ ]]; then - log "ERROR" "Invalid size '$size', must be empty or a positive number" - exit 2 - fi + [[ "$size" =~ ^([1-9][0-9]*)?$ ]] || { log "ERROR" "Invalid size '$size', must be empty or a positive number"; exit 2; } } calc_smart_volumes() { @@ -93,10 +89,7 @@ main() { check_dependencies "7z" check_input "$input_file" "$password" "$size" - if ! mkdir -p "$archive_dir"; then - log "ERROR" "Unable to create archive directory" - exit 1 - fi + mkdir -p "$archive_dir" || { log "ERROR" "Unable to create archive directory"; exit 1; } volumes="$(get_volumes "$input_file" "$size")" archive_name="$(generate_name)"