aboutsummaryrefslogtreecommitdiff
path: root/src/wg.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/wg.rs')
-rw-r--r--src/wg.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/wg.rs b/src/wg.rs
index b3ec451..745c7b4 100644
--- a/src/wg.rs
+++ b/src/wg.rs
@@ -8,13 +8,15 @@ use std::process::{Command, Stdio};
use std::{env, io};
pub struct Device {
- ifname: String,
+ ifname: OsString,
}
impl Device {
#[inline]
- pub fn new(ifname: String) -> io::Result<Self> {
- Ok(Device { ifname })
+ pub fn new(ifname: OsString) -> io::Result<Self> {
+ let dev = Device { ifname };
+ let _ = dev.get_public_key()?;
+ Ok(dev)
}
pub fn wg_command() -> Command {