From 0a09475342b6615d02ce0c31ef7b1feda5cf7f30 Mon Sep 17 00:00:00 2001 From: jan Date: Tue, 1 Feb 2022 16:18:19 +0100 Subject: [PATCH] Cancel script if input file could not be found --- vithumbs.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vithumbs.sh b/vithumbs.sh index 470e4ee..5ea17f9 100755 --- a/vithumbs.sh +++ b/vithumbs.sh @@ -7,6 +7,12 @@ fi # Input variables INPUT=$1 + +if [ ! -f "$INPUT" ]; then + echo "File not found." + exit 1 +fi + COLS=$2 if [ -z "$COLS" ]; then COLS=5