From 4d1ee409c5b6887ac4e4055e7f1dbf12e49f9d39 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Thu, 6 Jun 2024 20:48:44 +0800 Subject: [PATCH] =?UTF-8?q?alpine:=20=E4=BF=AE=E5=A4=8D=E7=9B=AE=E6=A0=87?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E4=B8=BA=20alpine=20liveos=20=E6=97=B6?= =?UTF-8?q?=E6=B2=A1=E6=98=BE=E7=A4=BA=E7=94=A8=E6=88=B7=E5=90=8D=E5=AF=86?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reinstall.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/reinstall.sh b/reinstall.sh index 8ce051f..c246a2e 100644 --- a/reinstall.sh +++ b/reinstall.sh @@ -9,6 +9,7 @@ github_proxy=https://mirror.ghproxy.com/https://raw.githubusercontent.com export LC_ALL=C # 处理部分用户用 su 切换成 root 导致环境变量没 sbin 目录 +# 不要漏了最后的 $PATH,否则会找不到 windows 系统程序例如 diskpart export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH this_script=$(realpath "$0") @@ -3036,6 +3037,17 @@ fi info 'info' echo "$distro $releasever" + +if ! { is_netboot_xyz || is_use_dd; }; then + if [ "$distro" = windows ]; then + username="administrator" + else + username="root" + fi + echo "Username: $username" + echo "Password: 123@@@" +fi + if is_netboot_xyz; then echo 'Reboot to start netboot.xyz.' elif is_alpine_live; then @@ -3043,14 +3055,6 @@ elif is_alpine_live; then elif is_use_dd; then echo 'Reboot to start DD.' else - if [ "$distro" = windows ]; then - username="administrator" - else - username="root" - fi - - echo "Username: $username" - echo "Password: 123@@@" echo "Reboot to start the installation." fi