Implement 'delete' command for interface removal and refactor 'add' command

This commit is contained in:
tuna2134
2026-06-30 12:22:53 +09:00
parent ff7f594a84
commit ebe437161b
5 changed files with 52 additions and 10 deletions

12
utils/delDev.go Normal file
View 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
}