action_nftBan: do not fail on delete; only on add

master
Y 2018-02-02 08:12:04 +01:00
parent 2a73c2d81f
commit 9ddc8394d4
1 changed files with 6 additions and 3 deletions

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)