mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-19 04:49:13 +08:00
core: 添加说明
This commit is contained in:
parent
8570970f41
commit
ce396271d6
@ -1,5 +1,8 @@
|
|||||||
# reinstall
|
# reinstall
|
||||||
|
|
||||||
|
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/dc679a17751448628fe6d8ac35e26eed)](https://app.codacy.com/gh/bin456789/reinstall/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
|
||||||
|
[![CodeFactor](https://www.codefactor.io/repository/github/bin456789/reinstall/badge)](https://www.codefactor.io/repository/github/bin456789/reinstall)
|
||||||
|
|
||||||
又一个重装脚本
|
又一个重装脚本
|
||||||
|
|
||||||
## 亮点
|
## 亮点
|
||||||
@ -31,6 +34,8 @@ curl -O https://ghps.cc/https://raw.githubusercontent.com/bin456789/reinstall/ma
|
|||||||
|
|
||||||
### 用法 1: 安装 Linux
|
### 用法 1: 安装 Linux
|
||||||
|
|
||||||
|
注意:静态 IP 的机器安装 centos、alma、rocky、fedora、debian、ubuntu,需添加参数 --ci 强制使用云镜像
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bash reinstall.sh centos 7|8|9 (8|9 为 stream 版本)
|
bash reinstall.sh centos 7|8|9 (8|9 为 stream 版本)
|
||||||
alma 8|9
|
alma 8|9
|
||||||
|
34
reinstall.sh
34
reinstall.sh
@ -130,6 +130,10 @@ is_netboot_xyz() {
|
|||||||
[ "$distro" = netboot.xyz ]
|
[ "$distro" = netboot.xyz ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_alpine_live() {
|
||||||
|
[ "$distro" = alpine ] && [ "$hold" = 1 ]
|
||||||
|
}
|
||||||
|
|
||||||
is_have_initrd() {
|
is_have_initrd() {
|
||||||
! is_netboot_xyz
|
! is_netboot_xyz
|
||||||
}
|
}
|
||||||
@ -673,8 +677,8 @@ install_pkg() {
|
|||||||
|
|
||||||
find_pkg_mgr() {
|
find_pkg_mgr() {
|
||||||
if [ -z "$pkg_mgr" ]; then
|
if [ -z "$pkg_mgr" ]; then
|
||||||
for c in dnf yum apt pacman zypper emerge apk; do
|
for mgr in dnf yum apt pacman zypper emerge apk; do
|
||||||
is_have_cmd $c && pkg_mgr=$c && return
|
is_have_cmd $mgr && pkg_mgr=$mgr && return
|
||||||
done
|
done
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@ -974,7 +978,7 @@ install_grub_win() {
|
|||||||
info download grub
|
info download grub
|
||||||
grub_ver=2.06
|
grub_ver=2.06
|
||||||
is_in_china && grub_url=https://mirrors.tuna.tsinghua.edu.cn/gnu/grub/grub-$grub_ver-for-windows.zip ||
|
is_in_china && grub_url=https://mirrors.tuna.tsinghua.edu.cn/gnu/grub/grub-$grub_ver-for-windows.zip ||
|
||||||
grub_url=https://mirror.fcix.net/gnu/grub/grub-$grub_ver-for-windows.zip
|
grub_url=https://ftpmirror.gnu.org/gnu/grub/grub-$grub_ver-for-windows.zip
|
||||||
curl -Lo /tmp/grub.zip $grub_url
|
curl -Lo /tmp/grub.zip $grub_url
|
||||||
# unzip -qo /tmp/grub.zip
|
# unzip -qo /tmp/grub.zip
|
||||||
7z x /tmp/grub.zip -o/tmp -r -y -xr!i386-efi -xr!locale -xr!themes -bso0
|
7z x /tmp/grub.zip -o/tmp -r -y -xr!i386-efi -xr!locale -xr!themes -bso0
|
||||||
@ -1491,14 +1495,22 @@ EOF
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if is_use_cloud_image; then
|
info 'info'
|
||||||
info 'cloud image mode'
|
echo "$distro $releasever"
|
||||||
|
if is_netboot_xyz; then
|
||||||
|
echo 'Reboot to start netboot.xyz.'
|
||||||
|
elif is_alpine_live; then
|
||||||
|
echo 'Reboot to start Alpine Live OS.'
|
||||||
elif is_use_dd; then
|
elif is_use_dd; then
|
||||||
info 'dd mode'
|
echo 'Reboot to start DD.'
|
||||||
elif is_netboot_xyz; then
|
|
||||||
info 'boot into netboot.xyz'
|
|
||||||
else
|
else
|
||||||
info 'installer mode'
|
if [ "$distro" = windows ]; then
|
||||||
fi
|
username="administrator"
|
||||||
|
else
|
||||||
|
username="root"
|
||||||
|
fi
|
||||||
|
|
||||||
info 'Please reboot to begin the installation'
|
echo "Username: $username"
|
||||||
|
echo "Password: 123@@@"
|
||||||
|
echo "Reboot to start the installation."
|
||||||
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user