diff --git a/src/handler/mod.rs b/src/handler/mod.rs index 91e6b87..41e4149 100644 --- a/src/handler/mod.rs +++ b/src/handler/mod.rs @@ -38,11 +38,11 @@ pub fn set_boot_counter(reboot_count: i32) -> Result<()> { log::info!("boot_counter={current_counter}"); bail!("counter already set"); } - Ok(None) => { + _ => { + //will still try to set boot_counter to override cases like boot_counter= log::info!("setting boot counter"); set_grub_var("boot_counter", reboot_count)?; } - Err(e) => bail!(e), } Ok(()) } diff --git a/src/main.rs b/src/main.rs index cfa7d7f..5ee5627 100644 --- a/src/main.rs +++ b/src/main.rs @@ -107,7 +107,7 @@ enum Commands { Rollback, } -/// this runs the scripts in required.d and wanted.d +/// runs all the scripts in required.d and wanted.d fn run_diagnostics() -> Result<()> { let mut required_script_failure: bool = false; let mut path_exists: bool = false; @@ -142,7 +142,7 @@ fn run_diagnostics() -> Result<()> { Ok(()) } -/// runs the scripts in red.d when health-check fails +/// runs all the scripts in red.d when health-check fails fn run_red() -> Result<(), Vec>> { let mut errors = Vec::new(); for path in GREENBOOT_INSTALL_PATHS { @@ -158,7 +158,7 @@ fn run_red() -> Result<(), Vec>> { } } -/// runs the scripts green.d when health-check passes +/// runs all the scripts green.d when health-check passes fn run_green() -> Result<(), Vec>> { let mut errors = Vec::new(); for path in GREENBOOT_INSTALL_PATHS {