Better use of ipset to manage timeouts reset

parent 8dbf0e02
......@@ -172,7 +172,7 @@ class NexDPI():
ipset_list = Cats[cname]['ipset']
log.info("CHECKCATEGORY: "+str(tuple(Cats[cname]['nostart'])))
if not aname.startswith(tuple(Cats[cname]['nostart'])) and not sername in list(Cats[cname]['noapps']):
sh("ipset test "+ipset_list+" "+triplet+" >/dev/null 2>&1 || ipset add "+ipset_list+" "+triplet+" timeout "+Cats[cname]['timeout']+" > /dev/null 2>&1")
sh("ipset add "+ipset_list+" "+triplet+" timeout "+Cats[cname]['timeout']+" --exist > /dev/null 2>&1")
log.info("ADD: "+ipset_list+" "+triplet+" "+self.fullname)
if sername in list(Cats[cname]['knownapps']):
self.isknown = True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment