Implement 'delete' command for interface removal and refactor 'add' command
This commit is contained in:
12
utils/delDev.go
Normal file
12
utils/delDev.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package utils
|
||||
|
||||
import "github.com/vishvananda/netlink"
|
||||
|
||||
func DelDev(devname string) error {
|
||||
link, err := netlink.LinkByName(devname)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
netlink.LinkDel(link)
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user