Browse Source

action_nftBan: do not fail on delete; only on add

master
Y 3 years ago
parent
commit
9ddc8394d4
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      pyruse/actions/action_nftBan.py

+ 6
- 3
pyruse/actions/action_nftBan.py View File

@ -41,9 +41,12 @@ class Action(base.Action):
pass # new file
if previousTS:
cmd = list(Action._nft)
cmd.append("delete element %s {%s}" % (nftSet, ip))
subprocess.run(cmd)
try:
cmd = list(Action._nft)
cmd.append("delete element %s {%s}" % (nftSet, ip))
subprocess.run(cmd)
except Exception:
pass # too late: not a problem
until = self._doBan(now, ip, nftSet)


Loading…
Cancel
Save