acct_unique with more than one Class attribute

Brian Candler b.candler at
Fri Mar 24 10:59:27 CET 2017

On 24/03/2017 09:48, Andrea Gabellini wrote:
> as a workaround I tried to use &Class[n] instead of &Class. The Class
> attribute is added in the reply as the last thing in post-auth. So if
> the NAS doesn't touch the list, probably this works.
> Is there a better solution?

It says "The foreach statement loops over a list of attributes", but I 
think it means "The foreach statement loops over all the instances of a 
specified attribute".  Example:

Or, if you can rewrite the whole test as a single regexp, then you try:

     if (&Class[*] =~ /regexp(captures)/) { ... }

More information about the Freeradius-Users mailing list