From 07ad2e7e7a558d494a16dea17768038c1747b0c4 Mon Sep 17 00:00:00 2001 From: Adam Bambuch Date: Sun, 21 Mar 2021 23:01:01 +0100 Subject: [PATCH] create_image.sh check part_type before creating --- create_image.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/create_image.sh b/create_image.sh index 4dbb921..ee93ddb 100755 --- a/create_image.sh +++ b/create_image.sh @@ -36,6 +36,11 @@ else size="${size}k" part_type=ntfs fi + +if [ "$part_type" != "ntfs" ] && [ "$part_type" != "fat32" ]; then + echo "$part_type is not supported, choose ntfs or fat32" 1>&2 + exit 1 +fi echo "Creating $size image..." @@ -50,7 +55,6 @@ elif [ "$part_type" = "fat32" ]; then mkfs.vfat "${dev}p1" fatlabel "${dev}p1" RPIHDD else - echo "$part_type is not supported, choose ntfs or fat32" exit 1 fi