v1.0.1
This commit is contained in:
12
src/main.rs
12
src/main.rs
@@ -79,6 +79,7 @@ async fn main() -> tide::Result<()> {
|
||||
.arg(Arg::with_name("check").long("check").help("Check cert config"))
|
||||
.arg(Arg::with_name("hide-logo").long("hide-logo").help("Hide logo"))
|
||||
.arg(Arg::with_name("skip-verify-ip").short("k").long("skip-verify-ip").help("Skip verify public ip"))
|
||||
.arg(Arg::with_name("skip-verify-certificate").short("K").long("skip-verify-certificate").help("Skip verify certificate"))
|
||||
.get_matches();
|
||||
|
||||
if matches.is_present("verbose") {
|
||||
@@ -99,7 +100,8 @@ async fn main() -> tide::Result<()> {
|
||||
let local_public_ip = if skip_verify_ip {
|
||||
None
|
||||
} else {
|
||||
Some(get_local_public_ip().unwrap_or_else(|e| {
|
||||
let skip_verify_certificate = matches.is_present("skip-verify-certificate");
|
||||
Some(get_local_public_ip(skip_verify_certificate).unwrap_or_else(|e| {
|
||||
failure!("Get local public ip failed: {}", e);
|
||||
exit(1);
|
||||
}))
|
||||
@@ -309,18 +311,18 @@ async fn main() -> tide::Result<()> {
|
||||
match run_command_and_wait(&mut cmd) {
|
||||
Ok(_) => {
|
||||
success!("Restart nginx success");
|
||||
dingtalk_message.push_str("\n\nrestart nginx success");
|
||||
dingtalk_message.push_str(&format!("\n\ntrigger after update success: {:?}", cmd));
|
||||
}
|
||||
Err(err) => {
|
||||
failure!("Restart nginx failed: {:?}", err);
|
||||
dingtalk_message.push_str(&format!("\n\nrestart nginx failed: {:?}", err));
|
||||
dingtalk_message.push_str(&format!("\n\ntrigger after update failed: {:?}, message: {:?}", cmd, err));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
warning!("No trigger after update is configed but is empty");
|
||||
warning!("No trigger after update is configured but is empty");
|
||||
}
|
||||
} else {
|
||||
warning!("No trigger after update configed");
|
||||
warning!("No trigger after update configured");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user