core: sleep 选项改名为 hold

This commit is contained in:
bin456789 2023-10-31 22:49:49 +08:00
parent 9d5726b28c
commit 20866ef84b
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B
3 changed files with 18 additions and 7 deletions

View File

@ -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 下使用
下载(链接另存为)放到同一目录

View File

@ -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'"

View File

@ -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