From 4f5ecdd55f60d340a556d1396b6de57dcbe5bcfd Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 9 Mar 2023 11:54:44 +0100 Subject: dont use sudo --- src/main.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index be73856..66d046f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -84,8 +84,8 @@ fn fasthash(data: &[u8]) -> u64 { } fn wg_dump(config: &Config) -> Result<(Pubkey, u16, Vec<(Pubkey, Option, u64)>)> { - let output = Command::new("sudo") - .args(["wg", "show", &config.interface, "dump"]) + let output = Command::new("wg") + .args(["show", &config.interface, "dump"]) .output()?; let mut lines = std::str::from_utf8(&output.stdout)?.split('\n'); @@ -256,9 +256,8 @@ impl Daemon { if !endpoints.is_empty() { let endpoint = endpoints[i % endpoints.len()]; info!("Configure {} with endpoint {}", peer.pubkey, endpoint.0); - Command::new("sudo") + Command::new("wg") .args([ - "wg", "set", &self.config.interface, "peer", -- cgit v1.2.3