From 6e6db70d1ca86db244257e5cc2cf4aade1075748 Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Wed, 5 May 2021 11:58:43 +0800 Subject: [PATCH] feat: check --- src/main.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index af544cd..730831b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -140,10 +140,14 @@ async fn main() -> tide::Result<()> { }; let account_dir = matches.value_of("dir").unwrap_or("acme_dir"); - let (s, r) = channel::bounded(1); - startup_http_server(s, port); - r.recv().await.ok(); - task::sleep(Duration::from_millis(500)).await; + let check = matches.is_present("check"); + + if !check { + let (s, r) = channel::bounded(1); + startup_http_server(s, port); + r.recv().await.ok(); + task::sleep(Duration::from_millis(500)).await; + } let cert_config = matches.value_of("config"); match cert_config { @@ -178,7 +182,7 @@ async fn main() -> tide::Result<()> { exit(1); }) }; - if matches.is_present("check") { + if check { check_cert_config(&cert_config); return Ok(()); }