diff --git a/configure_priv.sh b/configure_priv.sh index 6dc1406..5b4bd7a 100755 --- a/configure_priv.sh +++ b/configure_priv.sh @@ -315,6 +315,9 @@ configure_nginx() { echo "deb-src [signed-by=/usr/share/keyrings/nginx.gpg] https://nginx.org/packages/ubuntu/ $(lsb_release -cs) nginx" | sudo tee -a /etc/apt/sources.list.d/nginx.list >/dev/null fi if confirm_action "要安装 nginx 吗?" "Y"; then + if command_exists nginx && ! confirm_action "检测到旧版 nginx 的存在 ($(nginx -v 2>&1)),是否继续安装?" "N"; then + return + fi sudo apt-get update sudo apt-get install nginx -y echo "nginx 版本: $(nginx -v 2>&1)"