From 89f2e813cf50b4ed0c8d3c5489a1b890acc44499 Mon Sep 17 00:00:00 2001 From: Jake McGinty Date: Tue, 3 Aug 2021 00:44:06 +0900 Subject: [PATCH] client(install): fix install check failure when /var/run/wireguard doesn't exist --- client/src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/src/main.rs b/client/src/main.rs index f60b995..4434321 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -289,9 +289,11 @@ fn install( iface ); } - if Device::list(network.backend)? + let iface = iface.parse()?; + if Device::list(network.backend) .iter() - .any(|name| name.as_str_lossy() == iface) + .flatten() + .any(|name| name == &iface) { bail!( "An existing WireGuard interface with the name \"{}\" already exists.", @@ -299,7 +301,6 @@ fn install( ); } - let iface = iface.parse()?; redeem_invite(&iface, config, target_conf, network).map_err(|e| { log::error!("failed to start the interface: {}.", e); log::info!("bringing down the interface.");