[ipset] ménage
darcs-hash:20110227125846-ffbb2-55a2463b21c469fdd04dea5c99beffd2cd64b897.gz
This commit is contained in:
parent
c08b4c80ce
commit
26ca045510
1 changed files with 13 additions and 10 deletions
|
@ -42,11 +42,11 @@ class Ipset(object):
|
|||
def __init__(self,set,type,typeopt=''):
|
||||
self.set=set
|
||||
self.type=type
|
||||
self.typeoption=typeopt
|
||||
self.typeopt=typeopt
|
||||
|
||||
def call(self,cmd,arg=''):
|
||||
"""Appel système à ipset"""
|
||||
cmd_line="%s %s %s %s" % (ipset,cmd,self.set,arg)
|
||||
cmd_line="%s %s %s %s" % (self.ipset,cmd,self.set,arg)
|
||||
syslog.syslog(syslog.LOG_INFO,"ipset: %s, %s" % (self.set,arg))
|
||||
status,output=commands.getstatusoutput(cmd_line)
|
||||
if status:
|
||||
|
@ -75,4 +75,7 @@ class Ipset(object):
|
|||
def flush(self):
|
||||
self.call("-F")
|
||||
|
||||
def destroy(self):
|
||||
self.call("-X")
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue