From b617858c8966746ba583299897ba567619da7869 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Wed, 21 Jun 2023 23:39:08 +0800 Subject: [PATCH] =?UTF-8?q?--image-name=20=E9=98=B2=E6=AD=A2=E5=B8=B8?= =?UTF-8?q?=E8=A7=81=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reinstall.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reinstall.sh b/reinstall.sh index 69a38f7..7203f7c 100644 --- a/reinstall.sh +++ b/reinstall.sh @@ -191,6 +191,11 @@ setos() { if [ -z "$iso" ] || [ -z "$image_name" ]; then error_and_exit "Install Windows need --iso --image-name" fi + # 防止常见错误 + # --image-name 肯定大于等于3个单词 + if [ "$(echo "$image_name" | wc -w)" -lt 3 ]; then + error_and_exit "--image-name wrong." + fi test_url $iso iso eval "${step}_iso='$iso'" eval "${step}_image_name='$image_name'"