From 60c426a4cf19cb29ddd1870ef4ad0533ca74c786 Mon Sep 17 00:00:00 2001 From: Matt C Date: Tue, 11 May 2021 21:33:50 -0400 Subject: [PATCH] fail if $DISK doesn't exist --- crystinstall.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crystinstall.sh b/crystinstall.sh index 103efec..bd75c22 100755 --- a/crystinstall.sh +++ b/crystinstall.sh @@ -48,6 +48,10 @@ if [[ "$PMODE" == "y" ]]; then else prompt "Install target (will be WIPED COMPLETELY)" DISK="$response" + if [[ ! -f $DISK ]]; then + err "Seems like $DISK doesn't exist. Did you typo?" + exit 1 + fi fi if [[ $DISK == *"nvme"* ]]; then