diff --git a/src/utils.rs b/src/utils.rs index 0d166b4..b28832d 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -19,7 +19,7 @@ use tokio::join; use crate::files::file_handler; use crate::services::service_handler; -static GET_ID_CMD : &'static str = "cat /proc/self/mountinfo | grep '/docker/containers/' | head -1 | awk -F '/' '{print $6}'"; +static GET_ID_CMD : &'static str = r"cat /proc/self/mountinfo | grep '/docker/containers/' | head -1 | awk -F '/' '{print \$6}'"; /// # async func to run 3 main daemons (now its more like tree-form than classiacl 0.1.0 form ) /// > hint : give mpsc with capacity 1 to jump over potential errors during running process @@ -164,7 +164,7 @@ pub async fn running_handler // todo: cmd across cat /proc/self/mountinfo | grep "/docker/containers/" | head -1 | awk -F '/' '{print $5}' pub fn get_container_id() -> Option { - match Command::new(GET_ID_CMD).output() { + match Command::new("sh -c").arg(GET_ID_CMD).output() { Ok(output) => { Some(String::from_utf8_lossy(&output.stdout).to_string()) },