diff --git a/gestion/gen_confs/ipset.py b/gestion/gen_confs/ipset.py index 5a27b0cc..e635a1a9 100644 --- a/gestion/gen_confs/ipset.py +++ b/gestion/gen_confs/ipset.py @@ -21,6 +21,12 @@ sys.path.append('/usr/scripts/gestion') import commands import os +IPSET_PATH = '/sbin/ipset' + +# Avant jessie: ipset était dans /usr/sbin +if not os.path.exists(IPSET_PATH): + IPSET_PATH = '/usr' + IPSET_PATH + class IpsetError(Exception): # Gestion des erreurs d'ipset def __init__(self,cmd,err_code,output): @@ -31,7 +37,7 @@ class IpsetError(Exception): return "%s\n status : %s\n %s" % (self.cmd,self.err_code,self.output) class Ipset(object): - ipset="/usr/sbin/ipset" + ipset=IPSET_PATH def __str__(self): return self.set