mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-18 20:39:14 +08:00
core: sleep 选项改名为 hold
This commit is contained in:
parent
9d5726b28c
commit
20866ef84b
@ -66,6 +66,14 @@ bash reinstall.sh dd --img=https://example.com/xxx.xz
|
||||
|
||||
支持自动配置静态 IP、扩展系统盘
|
||||
|
||||
### 重启到 Alpine 救援系统(不运行重装)
|
||||
|
||||
可用 ssh 连接,进行手动 DD、修改分区等操作
|
||||
|
||||
```bash
|
||||
bash reinstall.sh alpine --hold=1
|
||||
```
|
||||
|
||||
## Windows 下使用
|
||||
|
||||
下载(链接另存为)放到同一目录
|
||||
|
@ -936,7 +936,7 @@ if ! is_in_windows; then
|
||||
fi
|
||||
|
||||
# 整理参数
|
||||
if ! opts=$(getopt -n $0 -o "" --long debug,sleep:,iso:,image-name:,img:,ci,cloud-image -- "$@"); then
|
||||
if ! opts=$(getopt -n $0 -o "" --long debug,hold:,sleep:,iso:,image-name:,img:,ci,cloud-image -- "$@"); then
|
||||
usage_and_exit
|
||||
fi
|
||||
|
||||
@ -952,8 +952,8 @@ while true; do
|
||||
cloud_image=1
|
||||
shift
|
||||
;;
|
||||
--sleep)
|
||||
sleep=$2
|
||||
--hold | --sleep)
|
||||
hold=$2
|
||||
shift 2
|
||||
;;
|
||||
--img)
|
||||
@ -1083,7 +1083,7 @@ build_finalos_cmdline() {
|
||||
}
|
||||
|
||||
build_extra_cmdline() {
|
||||
for key in confhome sleep cloud_image kernel; do
|
||||
for key in confhome hold cloud_image kernel; do
|
||||
value=${!key}
|
||||
if [ -n "$value" ]; then
|
||||
extra_cmdline+=" extra.$key='$value'"
|
||||
|
9
trans.sh
9
trans.sh
@ -1960,7 +1960,7 @@ printf '\nyes' | setup-sshd
|
||||
|
||||
extract_env_from_cmdline
|
||||
# shellcheck disable=SC2154
|
||||
if [ "$sleep" = 1 ]; then
|
||||
if [ "$hold" = 1 ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
@ -2015,10 +2015,13 @@ else
|
||||
install_redhat_ubuntu
|
||||
fi
|
||||
fi
|
||||
if [ "$sleep" = 2 ]; then
|
||||
if [ "$hold" = 2 ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
# 等几秒让 web ssh 输出全部内容
|
||||
# 让 web ssh 输出全部内容
|
||||
for i in $(seq 10); do
|
||||
echo
|
||||
done
|
||||
sleep 5
|
||||
reboot
|
||||
|
Loading…
x
Reference in New Issue
Block a user