mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2024-11-21 15:57:24 -06:00
Missed two files from previous commit
This commit is contained in:
parent
414f78c1d3
commit
bc60689984
38
src/rust/lqos_support_tool/src/support_info/distro_name.rs
Normal file
38
src/rust/lqos_support_tool/src/support_info/distro_name.rs
Normal file
@ -0,0 +1,38 @@
|
||||
use std::process::Command;
|
||||
use crate::console::success;
|
||||
use crate::support_info::SupportInfo;
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
pub struct DistroName {
|
||||
output: String,
|
||||
}
|
||||
|
||||
impl SupportInfo for DistroName {
|
||||
fn get_string(&self) -> String {
|
||||
self.output.to_string()
|
||||
}
|
||||
|
||||
fn get_name(&self) -> String {
|
||||
"LSB Distro Info".to_string()
|
||||
}
|
||||
|
||||
fn get_filename(&self) -> Option<String> {
|
||||
None
|
||||
}
|
||||
|
||||
fn gather(&mut self) -> anyhow::Result<()> {
|
||||
let output = Command::new("/bin/lsb_release")
|
||||
.arg("-a")
|
||||
.output()?;
|
||||
let out_str = String::from_utf8_lossy(output.stdout.as_slice());
|
||||
self.output = out_str.to_string();
|
||||
success("Gathered distro info");
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl DistroName {
|
||||
pub fn boxed() -> Box<Self> {
|
||||
Box::new(Self::default())
|
||||
}
|
||||
}
|
38
src/rust/lqos_support_tool/src/support_info/kernel_info.rs
Normal file
38
src/rust/lqos_support_tool/src/support_info/kernel_info.rs
Normal file
@ -0,0 +1,38 @@
|
||||
use std::process::Command;
|
||||
use crate::console::success;
|
||||
use crate::support_info::SupportInfo;
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
pub struct KernelInfo {
|
||||
output: String,
|
||||
}
|
||||
|
||||
impl SupportInfo for KernelInfo {
|
||||
fn get_string(&self) -> String {
|
||||
self.output.to_string()
|
||||
}
|
||||
|
||||
fn get_name(&self) -> String {
|
||||
"Uname Kernel Info".to_string()
|
||||
}
|
||||
|
||||
fn get_filename(&self) -> Option<String> {
|
||||
None
|
||||
}
|
||||
|
||||
fn gather(&mut self) -> anyhow::Result<()> {
|
||||
let output = Command::new("/bin/uname")
|
||||
.arg("-a")
|
||||
.output()?;
|
||||
let out_str = String::from_utf8_lossy(output.stdout.as_slice());
|
||||
self.output = out_str.to_string();
|
||||
success("Gathered kernel info");
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl KernelInfo {
|
||||
pub fn boxed() -> Box<Self> {
|
||||
Box::new(Self::default())
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user