f-10: code: add create and delete netns #10

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-01-08 23:37:35 +01:00
commit 454005d6ac
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
7 changed files with 107 additions and 0 deletions

14
internal/netns/exist.go Normal file
View 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)
}