From ba00ea143543cfc6b012759744df2e051d0d9776 Mon Sep 17 00:00:00 2001 From: Nikita Ivanov Date: Tue, 31 May 2022 23:40:31 +0500 Subject: [PATCH] Fallback if $fifo is empty --- helpers.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/helpers.sh b/helpers.sh index 9b1a42a..52f3f8c 100644 --- a/helpers.sh +++ b/helpers.sh @@ -9,12 +9,8 @@ fifo_open() { } setup_fifo() { - if [ -z "$fifo" ]; then - echo_err '$fifo is empty!' - exit 1 - fi - exit_code="${1:-127}" + [ -n "$fifo" ] || exit "$exit_code" [ -e "$fifo" ] || exit "$exit_code" fifo_open "$fifo" || exit "$exit_code" }