mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 14:08:06 +08:00
fix: 解决 Fail2ban 禁用方式切换失败的问题 (#3704)
This commit is contained in:
parent
e85ed7427a
commit
bbe1161dc2
@ -107,7 +107,7 @@ func (u *Fail2BanService) UpdateConf(req dto.Fail2BanUpdate) error {
|
|||||||
if req.Value == "firewallcmd-ipset" || req.Value == "ufw" {
|
if req.Value == "firewallcmd-ipset" || req.Value == "ufw" {
|
||||||
itemName := "ufw"
|
itemName := "ufw"
|
||||||
if req.Value == "firewallcmd-ipset" {
|
if req.Value == "firewallcmd-ipset" {
|
||||||
itemName = "firewallcmd"
|
itemName = "firewalld"
|
||||||
}
|
}
|
||||||
client, err := firewall.NewFirewallClient()
|
client, err := firewall.NewFirewallClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -106,6 +106,7 @@ func (f *Firewall) ListPort() ([]FireInfo, error) {
|
|||||||
}
|
}
|
||||||
itemRule := f.loadInfo(rule)
|
itemRule := f.loadInfo(rule)
|
||||||
if len(itemRule.Port) != 0 && itemRule.Family == "ipv4" {
|
if len(itemRule.Port) != 0 && itemRule.Family == "ipv4" {
|
||||||
|
itemRule.Family = ""
|
||||||
datas = append(datas, itemRule)
|
datas = append(datas, itemRule)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user