From 032d9362819d7dfc24741dff78d4cb8a70531777 Mon Sep 17 00:00:00 2001 From: diogo464 Date: Thu, 17 Jul 2025 14:51:03 +0100 Subject: fixed address listing on machines with no addresses currently the shell script used to list 10.0.0.0/8 range of addresses on a machine would fail with exit code 1 if no addresses were present in that range (i.e. grep did not match anything). this fix just makes sure that command always returns exit code 0. --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index aa673cb..9b9c815 100644 --- a/src/main.rs +++ b/src/main.rs @@ -658,7 +658,7 @@ async fn machines_configure(ctx: &Context, configs: &[MachineConfig]) -> Result< async fn machine_list_addresses(ctx: &Context, machine: Machine) -> Result> { tracing::info!("listing machine addresses"); let interface = machine.interface(); - let script = format!("ip addr show {interface} | grep -oE '10\\.[0-9]+\\.[0-9]+\\.[0-9]+'"); + let script = format!("ip addr show {interface} | grep -oE '10\\.[0-9]+\\.[0-9]+\\.[0-9]+' || true"); let output = machine_run_script(ctx, machine, &script).await?; let stdout = std::str::from_utf8(&output.stdout)?; let mut addresses = Vec::default(); -- cgit