Hmmm,
I've been been trying to use regex to get the 12 hex characters in the
Calling-Station-Id but, I must be doing something wrong.
In my hints file i have
DEFAULT Calling-Station-Id =~
"(\w\w)\-(\w\w)\-(\w\w)\-(\w\w)\-(\w\w)\-(\w\w)"
User-Name := `%{0}`
This should set the User Name to the hex characters in the mac address
or 'something' at least
However, in debug mode I can see that User-Name is not modified.
In perl i can use the regex below and it seems to work
PERL
-=-=-=-=-==-==-=-=-=-=-==-=-
my $string = '23-00-ab-fa-ee-23';
if( $string =~ /(\w\w)\-(\w\w)\-(\w\w)\-(\w\w)\-(\w\w)\-(\w\w)/ )
{
print $1,$2,$3,$4,$5,$6;
}
-=-=-=-=-==-==-=-=-=-=-==-=-
What am I doing wrong? How do I fix it?
Thanks,
On Fri, 2004-10-15 at 09:03, Alan DeKok wrote:
> Jose Guevarra <[EMAIL PROTECTED]> wrote:
> > I have freeradius authenticating mac addresses listed in a MySQL
> > database. It works! But, the mac address passed by the client(hp 2650)
> > is in the form 00-00-00-00-00-00. I set the 'user name' to the 'calling
> > station id' in the 'hints' file like so
> >
> > User-Name := "%i"
> >
> > Is it possible to filter out the "-" or ":" or put it into any format I
> > like?
>
> Yes. Use regular expressions. See doc/variables.txt
>
> Alan DeKok.
>
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html