NftExePath 查找nftables可执行文件路径
()
| 54 | |
| 55 | // NftExePath 查找nftables可执行文件路径 |
| 56 | func 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 | |
| 74 | type Installer struct { |
| 75 | } |