Revisión 270
Añadido por jredrejo hace más de 13 años
configura_hostapd.py | ||
---|---|---|
format='%(asctime)s %(levelname)-8s %(message)s',
|
||
datefmt='%a, %d %b %Y %H:%M:%S',
|
||
filename=LOG_FILENAME)
|
||
|
||
dia_hoy=""
|
||
hora=""
|
||
user=""
|
||
fich=""
|
||
hos=""
|
||
res=""
|
||
f=""
|
||
|
||
if len(sys.argv)>1:
|
||
dia_hoy=""
|
||
hora=""
|
||
user=""
|
||
fich=""
|
||
hos=""
|
||
res=""
|
||
f=""
|
||
|
||
dia_hoy=dia_actual()
|
||
hora=hora_actual(dia_hoy)
|
||
fich=fichero_semana(dia_hoy)
|
||
f=descargar_fichero(fich)
|
||
if f!="":
|
||
user=devuelve_usuario()
|
||
if userIsTeacher(user):
|
||
hos=crea_hostapd(f,user,hora)
|
||
else: #login de un alumno
|
||
subprocess.Popen(["invoke-rc.d","hostapd","stop"]).wait()
|
||
sys.exit(0)
|
||
|
||
if hos=="":
|
||
logging.getLogger().error("Error al generar las mac autorizadas")
|
||
dia_hoy=dia_actual()
|
||
hora=hora_actual(dia_hoy)
|
||
fich=fichero_semana(dia_hoy)
|
||
f=descargar_fichero(fich)
|
||
if f!="":
|
||
user=devuelve_usuario()
|
||
if userIsTeacher(user):
|
||
hos=crea_hostapd(f,user,hora)
|
||
else: #login de un alumno
|
||
subprocess.Popen(["invoke-rc.d","hostapd","stop"]).wait()
|
||
sys.exit(0)
|
||
|
||
if hos=="":
|
||
logging.getLogger().error("Error al generar las mac autorizadas")
|
||
|
||
|
||
#Aquí metemos ahora la reconfiguración de hostapd.conf con la parte
|
Exportar a: Unified diff
versión para ordenadores con Squeeze