mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-14 19:00:50 +01:00
fd67892cb4
Refactor the flat code structure
18 lines
338 B
Go
18 lines
338 B
Go
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
|
|
|
|
package iface
|
|
|
|
import (
|
|
"fmt"
|
|
"os/exec"
|
|
)
|
|
|
|
func (w *WGIface) Destroy() error {
|
|
out, err := exec.Command("ifconfig", w.Name(), "destroy").CombinedOutput()
|
|
if err != nil {
|
|
return fmt.Errorf("failed to remove interface %s: %w - %s", w.Name(), err, out)
|
|
}
|
|
|
|
return nil
|
|
}
|