feat: check

This commit is contained in:
2021-05-05 11:58:43 +08:00
parent fe63d29adb
commit 6e6db70d1c

View File

@@ -140,10 +140,14 @@ async fn main() -> tide::Result<()> {
}; };
let account_dir = matches.value_of("dir").unwrap_or("acme_dir"); let account_dir = matches.value_of("dir").unwrap_or("acme_dir");
let (s, r) = channel::bounded(1); let check = matches.is_present("check");
startup_http_server(s, port);
r.recv().await.ok(); if !check {
task::sleep(Duration::from_millis(500)).await; 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"); let cert_config = matches.value_of("config");
match cert_config { match cert_config {
@@ -178,7 +182,7 @@ async fn main() -> tide::Result<()> {
exit(1); exit(1);
}) })
}; };
if matches.is_present("check") { if check {
check_cert_config(&cert_config); check_cert_config(&cert_config);
return Ok(()); return Ok(());
} }