diff --git a/install.sh b/install.sh index afcee27..f08eb44 100755 --- a/install.sh +++ b/install.sh @@ -293,11 +293,11 @@ check_memory() { plain " fallocate -l 1G /swapfile && chmod 600 /swapfile && \\" plain " mkswap /swapfile && swapon /swapfile && \\" plain " echo '/swapfile none swap sw 0 0' >> /etc/fstab" + if ! ask_yes_no "现在继续安装吗?" "y"; then + die "已按你的选择中止。" "加好 swap 后重新运行本脚本即可。" + fi else - hint "已检测到 ${swap_mb} MB swap,风险较低,可继续。" - fi - if ! ask_yes_no "现在继续安装吗?" "y"; then - die "已按你的选择中止。" "加好 swap 后重新运行本脚本即可。" + hint "已检测到 ${swap_mb} MB swap,风险较低,自动继续。" fi else ok "内存:${mem_mb} MB(swap ${swap_mb} MB)"