Skip to content

Commit

Permalink
create_image.sh check part_type before creating
Browse files Browse the repository at this point in the history
  • Loading branch information
tjmnmk committed Mar 21, 2021
1 parent a8ed54c commit 07ad2e7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion create_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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..."

Expand All @@ -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

Expand Down

0 comments on commit 07ad2e7

Please sign in to comment.