MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / NftExePath

Function NftExePath

internal/firewalls/nftables/installer.go:56–72  ·  view source on GitHub ↗

NftExePath 查找nftables可执行文件路径

()

Source from the content-addressed store, hash-verified

54
55// NftExePath 查找nftables可执行文件路径
56func NftExePath() string {
57 path, _ := executils.LookPath("nft")
58 if len(path) > 0 {
59 return path
60 }
61
62 for _, possiblePath := range []string{
63 "/usr/sbin/nft",
64 } {
65 _, err := os.Stat(possiblePath)
66 if err == nil {
67 return possiblePath
68 }
69 }
70
71 return ""
72}
73
74type Installer struct {
75}

Callers 6

ApplyMethod · 0.92
addTCPRulesMethod · 0.92
initFunction · 0.92
initMethod · 0.92
initFunction · 0.85
InstallMethod · 0.85

Calls 1

StatMethod · 0.65

Tested by

no test coverage detected