Use ip link show to detect bridge
ip tuntap show lists all tuntap devices and ignores the rest of the arguments, annoyingly. It will always return with exit code 0. We do not detect if the interface is a bridge.
This commit is contained in:
parent
bc71e26756
commit
b4a4a28634
|
@ -233,7 +233,7 @@ let bridge_exists bridge_name =
|
||||||
let cmd =
|
let cmd =
|
||||||
match Lazy.force uname with
|
match Lazy.force uname with
|
||||||
| FreeBSD -> Bos.Cmd.(v "ifconfig" % bridge_name)
|
| FreeBSD -> Bos.Cmd.(v "ifconfig" % bridge_name)
|
||||||
| Linux -> Bos.Cmd.(v "ip" % "tuntap" % "show" % bridge_name)
|
| Linux -> Bos.Cmd.(v "ip" % "link" % "show" % bridge_name)
|
||||||
in
|
in
|
||||||
Bos.OS.Cmd.(run_out ~err:err_null cmd |> out_null |> success)
|
Bos.OS.Cmd.(run_out ~err:err_null cmd |> out_null |> success)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue