windows: 优化 server 2008 防呆代码

This commit is contained in:
bin456789 2024-07-07 17:07:18 +08:00
parent 2c2dd923ab
commit 96d7b56f9f
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B
3 changed files with 10 additions and 14 deletions

View File

@ -154,7 +154,7 @@ bash reinstall.sh centos 7|9 (9 is stream version)
### Feature 2: DD
- Supports gzip, xz formats.
- For machines with static IP, DD Windows, and the script will automatically configure the IP.
- A machine with a static IP running DD Windows will automatically configure the IP, which may take a few minutes to complete after the first boot.
> [!TIP]
> Can monitor the progress through various methods (SSH, HTTP 80 port, VNC in the background, serial console).

View File

@ -154,7 +154,7 @@ bash reinstall.sh centos 7|9 (9 为 stream 版本)
### 功能 2: DD
- 支持 gzip、xz 格式
- 静态 IP 的机器 DD Windows会自动配置好 IP
- 静态 IP 的机器 DD Windows会自动配置好 IP,可能首次开机后几分钟才完成配置
> [!TIP]
> 可通过多种方式SSH、HTTP 80 端口、后台 VNC、串行控制台查看安装进度。

View File

@ -454,11 +454,6 @@ parse_windows_image_name() {
fi
version=$1
# 填写 windows longhorn serverdatacenter 时,寻找 windows server 2008 serverdatacenter iso
if [ "$version" = longhorn ]; then
server=server
version=2008
fi
shift
if [ "$1" = r2 ]; then
@ -467,8 +462,8 @@ parse_windows_image_name() {
fi
edition=
for i in "$@"; do
case "$i" in
while [ $# -gt 0 ]; do
case "$1" in
# windows 10 enterprise n ltsc 2021
k | n | kn) ;;
*)
@ -972,15 +967,16 @@ setos() {
setos_windows() {
if [ -z "$iso" ]; then
# 查找时将 windows longhorn serverdatacenter 改成 windows server 2008 serverdatacenter
image_name=${image_name/windows longhorn server/windows server 2008 server}
echo "iso url is not set. Try to find it."
find_windows_iso
fi
# 防呆设计
# 将 windows server 2008 改成 windows longhorn
if ! echo "$image_name" | grep -q r2; then
image_name=${image_name/server 2008/longhorn}
fi
# 将上面的 windows server 2008 serverdatacenter 改回 windows longhorn serverdatacenter
# 也能纠正用户输入了 windows server 2008 serverdatacenter
# 注意 windows server 2008 r2 serverdatacenter 不用改
image_name=${image_name/windows server 2008 server/windows longhorn server}
test_url $iso 'iso|dos/mbr'
eval "${step}_iso='$iso'"