diff --git a/README.adoc b/README.adoc index 6a59041..25e5405 100644 --- a/README.adoc +++ b/README.adoc @@ -35,7 +35,7 @@ You can optionally specify `check_type`: === Execute commands -_This feature is experimental and starts further commands only after previous commands have been finished._ +_This feature is still experimental._ You can also specify a command to be executed when a mouse click occurs on a checked host. Use `click_cmd` to specifiy the command to be executed, e.g. diff --git a/src/main.rs b/src/main.rs index 866b533..5bf2f57 100644 --- a/src/main.rs +++ b/src/main.rs @@ -132,17 +132,11 @@ async fn get_click_cmd(name: String) -> Option { } async fn run_click_cmd(cmd: String) { - let _r = match std::process::Command::new("sh") + if let Ok(mut child) = std::process::Command::new("sh") .stdin(std::process::Stdio::piped()) - .stderr(std::process::Stdio::piped()) - .spawn() - { - Ok(mut child) => { + .spawn() { use std::io::Write; - let _r = child.stdin.as_mut().unwrap().write_all(cmd.as_bytes()); - child.wait() - } - Err(e) => Err(e), + let _ = child.stdin.as_mut().unwrap().write_all(cmd.as_bytes()); }; }