
Quand une machine se connecte pour la première fois, et qu'elle a une mac auto on enregistre la vraie, et on trigger generate sur komaz.
26 lines
508 B
Python
Executable file
26 lines
508 B
Python
Executable file
#!/bin/bash /usr/scripts/python.sh
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import auth
|
|
import sys
|
|
import time
|
|
|
|
if len(sys.argv) < 2 and False:
|
|
print "Give me a mac !"
|
|
sys.exit(1)
|
|
|
|
# Machine à s'authentifier (cerveaulent)
|
|
#p=(('Calling-Station-Id', sys.argv[1]),)
|
|
|
|
p=(
|
|
('Calling-Station-Id', 'ba:27:eb:3c:54:d5'),
|
|
('User-Name', 'test18'),
|
|
)
|
|
|
|
print repr(auth.wifi_authorize(p))
|
|
print "wait for 3s, tu peux aller crasher le serveur pg ou ldap"
|
|
sys.stdout.flush()
|
|
|
|
time.sleep(3)
|
|
|
|
print repr(auth.post_auth(p))
|