Hello everyone

I need to update some check and replay  attribute in database when get stop in accounting  and the session is finish

i need to know  in which section of  virtual server file (  sites-enabled/default) i need to put unlang script (and/or perl script) ?

and 

how i can check in script if accounting get stop packet , read  some radacct fild of that session   to do some calculate and do some query in database in radcheck and radreplay .


Best regards.