fix get cont id fn
parent
9f33396f95
commit
d1adc6baf0
|
|
@ -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<String> {
|
||||
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())
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue