{
debug!("{}: config: {:?}", &ic, &ic);
+ let mut ipif = tokio::process::Command::new("sh")
+ .args(&["-c", &ic.ipif])
+ .stdin (process::Stdio::piped())
+ .stdout(process::Stdio::piped())
+ .stderr(process::Stdio::piped())
+ .kill_on_drop(true)
+ .spawn().context("spawn ipif")?;
+
+ let stderr = ipif.stderr.take().unwrap();
+ let ic_name = ic.to_string();
+ let _ = task::spawn(async move {
+ let mut stderr = tokio::io::BufReader::new(stderr).lines();
+ while let Some(l) = stderr.next_line().await? {
+ error!("{}: ipif stderr: {}", &ic_name, l.trim_end());
+ }
+ Ok::<_,io::Error>(())
+ });
+
+ let stream_for_tx = ipif.stdout.take().unwrap();
+ let stream_for_rx = ipif.stdin .take().unwrap();
+// let txbuf = VecDeque::new();
+/*
+ async {
+ loop {
+ select! {
+ rx = stream_for_rx
+ */
throw!(anyhow!("arrgh"));
}
pub use lazy_regex::{regex_is_match, regex_replace_all};
pub use log::{debug, info, error};
pub use structopt::StructOpt;
+pub use tokio::io::AsyncBufReadExt;
pub use tokio::task;
pub use tokio::time::Duration;
pub use void::{self, Void, ResultVoidExt, ResultVoidErrExt};