scripts/freeradius/test.py

30 lines
564 B
Python
Executable file

#!/bin/bash /usr/scripts/python.sh
# -*- coding: utf-8 -*-
import auth
import sys
import time
delattr(sys, 'argv')
#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]),)
auth.instantiate(())
p=(
('Calling-Station-Id', 'b0:79:94:cf:d1:9a'),
('User-Name', 'moo-torola'),
)
print repr(auth.authorize_wifi(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_wifi(p))