Missed two files from previous commit

This commit is contained in:
Herbert Wolverson 2024-06-14 15:07:26 -05:00
parent 414f78c1d3
commit bc60689984
2 changed files with 76 additions and 0 deletions

View 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())
}
}

View 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())
}
}