Thank you<br><br>Baically what I have done is this. I wanting to use freeradius to be the radius server for a few of my hotspots. <br><br>They use two different NAS devices.Now the problem I faced is that both NASes use different VSA's for limiting users bandwidth. So my perl script will check the NAS-Identifier and cross reference it with a table in the DB and collect the appropriate NAS device. Then I have a attribute in the radcheck table called databank, I take the value of that attribute and put it together with the attribute that my NAS will understand. This all seems to be ok, the only thing I need to do now is, when the accounting-stop packet arrives, I need to be able to take sum(acctinputoctets+acctoutputoctets) and subtract that from the total of Databank. This way no matter if a user is coming from hostpot with device A to hotspot with device B the amount of data that he can move will be constant.<br>
<br>I can right the script, but I am not sure where to do it. How can you right a script to act on accounting-stop packet?<br><br>Thanks<br><br><div class="gmail_quote">On Mon, Aug 9, 2010 at 9:44 AM, Alan Buxey <span dir="ltr"><<a href="mailto:A.L.M.Buxey@lboro.ac.uk">A.L.M.Buxey@lboro.ac.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi,<br>
<div class="im"><br>
> I see know that it was my fault (obviously it was going to be). I am using sql, and not the users file as the guide (<a href="http://wiki.freeradius.org/Rlm_perl" target="_blank">http://wiki.freeradius.org/Rlm_perl</a>) suggests. I added Auth-Type attribute into the table and I know cannot login with the user baduser.<br>

> So radcheck used to look like this<br>
><br>
> +------+----------+-----------+----+---------+<br>
> | id   | username | attribute | op | value   |<br>
> +------+----------+-----------+----+---------+<br>
> 8813 | baduser  | password  | == | baduser<br>
> +------+----------+-----------+----+---------+<br>
><br>
> it now looks like this.<br>
><br>
> +------+----------+-----------+----+---------+<br>
> | id   | username | attribute | op | value   |<br>
> +------+----------+-----------+----+---------+<br>
> | 8813 | baduser  | password  | == | baduser |<br>
> | 8814 | baduser  | Auth-Type | =  | Perl    |<br>
> +------+----------+-----------+----+---------+<br>
<br>
</div>using a recent version of FR?  if so, change that first line to be<br>
<br>
| 8813 | baduser  | cleartext-password  | := | baduser |<br>
<br>
(as per the docs!)<br>
<br>
<br>
your initial question.....'what is /^baduser/i ?'  - its a quick<br>
function that checks the User-Name attribute and see if it matches<br>
(and begins with) the word 'baduser' (and is case insensitive). its<br>
a quick demo to show that things that you can do.... if you were<br>
to do this in production, you'd probably have an array of 'bad users'<br>
and do a loop function in which you check User-Name against<br>
all members of that array (and return a found or not found code back<br>
to the routine that fired off the check....eg<br>
<br>
if (baduser() ){<br>
}<br>
<br>
<br>
etc.<br>
<font color="#888888"><br>
<br>
alan<br>
</font><div><div></div><div class="h5">-<br>
List info/subscribe/unsubscribe? See <a href="http://www.freeradius.org/list/users.html" target="_blank">http://www.freeradius.org/list/users.html</a><br>
</div></div></blockquote></div><br>