dont use sudo
This commit is contained in:
parent
ae4acb2e91
commit
4f5ecdd55f
1 changed files with 3 additions and 4 deletions
|
@ -84,8 +84,8 @@ fn fasthash(data: &[u8]) -> u64 {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn wg_dump(config: &Config) -> Result<(Pubkey, u16, Vec<(Pubkey, Option<SocketAddr>, u64)>)> {
|
fn wg_dump(config: &Config) -> Result<(Pubkey, u16, Vec<(Pubkey, Option<SocketAddr>, u64)>)> {
|
||||||
let output = Command::new("sudo")
|
let output = Command::new("wg")
|
||||||
.args(["wg", "show", &config.interface, "dump"])
|
.args(["show", &config.interface, "dump"])
|
||||||
.output()?;
|
.output()?;
|
||||||
let mut lines = std::str::from_utf8(&output.stdout)?.split('\n');
|
let mut lines = std::str::from_utf8(&output.stdout)?.split('\n');
|
||||||
|
|
||||||
|
@ -256,9 +256,8 @@ impl Daemon {
|
||||||
if !endpoints.is_empty() {
|
if !endpoints.is_empty() {
|
||||||
let endpoint = endpoints[i % endpoints.len()];
|
let endpoint = endpoints[i % endpoints.len()];
|
||||||
info!("Configure {} with endpoint {}", peer.pubkey, endpoint.0);
|
info!("Configure {} with endpoint {}", peer.pubkey, endpoint.0);
|
||||||
Command::new("sudo")
|
Command::new("wg")
|
||||||
.args([
|
.args([
|
||||||
"wg",
|
|
||||||
"set",
|
"set",
|
||||||
&self.config.interface,
|
&self.config.interface,
|
||||||
"peer",
|
"peer",
|
||||||
|
|
Loading…
Reference in a new issue