dont use sudo

This commit is contained in:
Alex 2023-03-09 11:54:44 +01:00
parent ae4acb2e91
commit 4f5ecdd55f
1 changed files with 3 additions and 4 deletions

View File

@ -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",