portail_captif: corrige path vers ipset
This commit is contained in:
parent
e7ba8c346d
commit
ade4a9d82e
1 changed files with 2 additions and 1 deletions
|
@ -10,6 +10,7 @@ if '/usr/scripts' not in sys.path:
|
||||||
import lc_ldap.shortcuts
|
import lc_ldap.shortcuts
|
||||||
import lc_ldap.objets
|
import lc_ldap.objets
|
||||||
from iptools import AddrInNet, NetSubnets, IpSubnet
|
from iptools import AddrInNet, NetSubnets, IpSubnet
|
||||||
|
from gestion.gen_confs.ipset import IPSET_PATH
|
||||||
def _get_ldap_connection():
|
def _get_ldap_connection():
|
||||||
return lc_ldap.shortcuts.lc_ldap_readonly(user=u'root')
|
return lc_ldap.shortcuts.lc_ldap_readonly(user=u'root')
|
||||||
QUERY = _get_ldap_connection()
|
QUERY = _get_ldap_connection()
|
||||||
|
@ -91,7 +92,7 @@ def mac_from_ip(ip):
|
||||||
|
|
||||||
def enable_access(ip):
|
def enable_access(ip):
|
||||||
"""Lance la commande idoine pour autoriser l'adresse IP"""
|
"""Lance la commande idoine pour autoriser l'adresse IP"""
|
||||||
cmd = ['/usr/sbin/ipset', 'add', 'CONFIRMATION', ip]
|
cmd = [IPSET_PATH, 'add', 'CONFIRMATION', ip]
|
||||||
p = subprocess.Popen(['sudo', '-n'] + cmd,
|
p = subprocess.Popen(['sudo', '-n'] + cmd,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue