feat: support iptables-nft if iptables is not valid

This commit is contained in:
mzz2017 committed 2022-09-08 23:12:20 +08:00
1 parent 2609c2f447
commit 6ec215a045
1 file changed
+4
+4
View File
@@ -56,6 +56,10 @@ func (c Setter) Run(stopAtError bool) error {
if common.IsDocker() {
commands = strings.ReplaceAll(commands, "iptables", "iptables-legacy")
commands = strings.ReplaceAll(commands, "ip6tables", "ip6tables-legacy")
} else if !cmds.IsCommandValid("iptables") &&
cmds.IsCommandValid("iptables-nft") {
commands = strings.ReplaceAll(commands, "iptables", "iptables-nft")
commands = strings.ReplaceAll(commands, "ip6tables", "ip6tables-nft")
}
var errs []error
if c.PreFunc != nil {