Skip to content

Commit

Permalink
fix releasing bot
Browse files Browse the repository at this point in the history
  • Loading branch information
jackcvr committed Oct 31, 2024
1 parent ea2b9f7 commit c00f86f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,13 @@ func main() {
attempts[ip] = 0
if out, err := exec.Command("ufw", "deny", "from", ip).CombinedOutput(); err != nil {
slog.Error("exec", "error", string(out))
} else {
releaseCmd := fmt.Sprintf(`echo "ufw delete deny from %s" | at now + %s`, ip, config.JailDuration)
if out, err = exec.Command("/bin/sh", "-c", releaseCmd).CombinedOutput(); err != nil {
slog.Error("exec", "error", string(out))
}
slog.Info("jailed", "ip", ip, "term", config.JailDuration)
}
releaseCmd := fmt.Sprintf(`echo "ufw delete deny from %s" | at now + %s`, ip, config.JailDuration)
if out, err := exec.Command("/bin/sh", "-c", releaseCmd).CombinedOutput(); err != nil {
slog.Error("exec", "error", string(out))
}
slog.Info("jailed", "ip", ip, "term", config.JailDuration)
}

if cmd != "" {
Expand Down

0 comments on commit c00f86f

Please sign in to comment.