f-10: code: add create and delete netns #10
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
473e1d0108
commit
454005d6ac
7 changed files with 107 additions and 0 deletions
14
internal/netns/exist.go
Normal file
14
internal/netns/exist.go
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
package netns
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
func exist(name string) bool {
|
||||
_, err := os.Stat("/var/run/netns/" + name)
|
||||
return err == nil
|
||||
}
|
||||
|
||||
func Exist(name string) bool {
|
||||
return exist(name)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue