mirror of
https://github.com/tonarino/innernet.git
synced 2025-01-24 05:16:32 +02:00
client(install): bail if WireGuard interface with same name exists
Closes #113
This commit is contained in:
parent
40e8ca68f9
commit
61b055c44b
@ -284,7 +284,10 @@ fn install(
|
|||||||
|
|
||||||
let target_conf = CLIENT_CONFIG_DIR.join(&iface).with_extension("conf");
|
let target_conf = CLIENT_CONFIG_DIR.join(&iface).with_extension("conf");
|
||||||
if target_conf.exists() {
|
if target_conf.exists() {
|
||||||
bail!("An interface with this name already exists in innernet.");
|
bail!("An existing innernet network with the name \"{}\" already exists.", iface);
|
||||||
|
}
|
||||||
|
if Device::list(network.backend)?.iter().any(|name| name.as_str_lossy() == iface) {
|
||||||
|
bail!("An existing WireGuard interface with the name \"{}\" already exists.", iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
let iface = iface.parse()?;
|
let iface = iface.parse()?;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user