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 pass # new file
if previousTS: if previousTS:
cmd = list(Action._nft) try:
cmd.append("delete element %s {%s}" % (nftSet, ip)) cmd = list(Action._nft)
subprocess.run(cmd) 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) until = self._doBan(now, ip, nftSet)