()
| 49 | } |
| 50 | |
| 51 | func (this *Firewalld) init() { |
| 52 | goman.New(func() { |
| 53 | for c := range this.cmdQueue { |
| 54 | var cmd = c.cmd |
| 55 | err := cmd.Run() |
| 56 | if err != nil { |
| 57 | if strings.HasPrefix(err.Error(), "Warning:") { |
| 58 | continue |
| 59 | } |
| 60 | remotelogs.Warn("FIREWALL", "run command failed '"+cmd.String()+"': "+err.Error()) |
| 61 | } else { |
| 62 | // 关闭连接 |
| 63 | if len(c.denyIP) > 0 { |
| 64 | conns.SharedMap.CloseIPConns(c.denyIP) |
| 65 | } |
| 66 | } |
| 67 | } |
| 68 | }) |
| 69 | } |
| 70 | |
| 71 | // Name 名称 |
| 72 | func (this *Firewalld) Name() string { |
no test coverage detected