From 2229ae89a642a90e14c5d25608c5edbf653c3f84 Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Sun, 21 Jan 2018 22:08:43 +0000 Subject: [PATCH] Don't allow a directory to be selected The `-e` flag checks for a file _or_ a directory of that name. The `-f` flag checks only for files. --- pishrink.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pishrink.sh b/pishrink.sh index 447c7c4..0b317b1 100755 --- a/pishrink.sh +++ b/pishrink.sh @@ -19,7 +19,7 @@ img="$1" if [[ -z "$img" ]]; then usage fi -if [[ ! -e "$img" ]]; then +if [[ ! -f "$img" ]]; then echo "ERROR: $img is not a file..." exit -2 fi