tried to pass hddtemp executable

main
Nickiel12 1 year ago
parent 5ddc4274c8
commit cb4def2aee

@ -98,7 +98,7 @@ rust-project TODO: write shell script for automatically updating `cargoHash`
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
ExecStart = '' ExecStart = ''
${cfg.package}/bin/status_cloud --config-file ${builtins.toString cfg.config_path} ${cfg.package}/bin/status_cloud --hddtemp-executable ${pkg.hddtemp} --config-file ${builtins.toString cfg.config_path}
''; '';
}; };
}; };

@ -60,10 +60,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
} }
} }
match Command::new("hddtemp").output() { match Command::new(args.hddtemp_executable.clone()).output() {
Ok(val) => val, Ok(val) => val,
Err(e) => { Err(e) => {
println!("Error running hddtemp at all: {}", e.to_string()); println!("Error running hddtemp at all: {}", e.to_string());
println!("hddtemp = {}", args.hddtemp_executable.clone());
return Ok(()); return Ok(());
} }
}; };
@ -72,7 +73,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut drive_temps: Vec<String> = vec![]; let mut drive_temps: Vec<String> = vec![];
for drive in drives { for drive in drives {
let output = match Command::new("hddtemp").arg(drive.clone()).output() { let output = match Command::new(args.hddtemp_executable.clone()).arg(drive.clone()).output() {
Ok(val) => val, Ok(val) => val,
Err(e) => { Err(e) => {
println!("Error running hddtemp: {}", e.to_string()); println!("Error running hddtemp: {}", e.to_string());
@ -154,4 +155,7 @@ struct CliArgs {
/// Path to config .toml file /// Path to config .toml file
#[arg(short, long)] #[arg(short, long)]
config_file: String, config_file: String,
#[arg(short, long)]
hddtemp_executable: String,
} }

Loading…
Cancel
Save