aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-03-09 11:54:44 +0100
committerAlex Auvolat <alex@adnab.me>2023-03-09 11:54:44 +0100
commit4f5ecdd55f60d340a556d1396b6de57dcbe5bcfd (patch)
tree09029e593b4a527859aaa58b7f1b058cd1ab44fb /src
parentae4acb2e913071f6c0019d6ee2bc484507693f32 (diff)
downloadwgautomesh-4f5ecdd55f60d340a556d1396b6de57dcbe5bcfd.tar.gz
wgautomesh-4f5ecdd55f60d340a556d1396b6de57dcbe5bcfd.zip
dont use sudo
Diffstat (limited to 'src')
-rw-r--r--src/main.rs7
1 files 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<SocketAddr>, 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",