how to call an external script

Ivan Kalik tnt at kalik.net
Mon Oct 19 23:28:28 CEST 2009


> I want freeradius calls an external script and send to it the User-Name it
> gets from the NAS in an access-request radius packet.
>
> So I am using the echo module, I configure as:
>
>  #
>         #  The name of the program to execute, and it's
>         #  arguments.  Dynamic translation is done on this
>         #  field, so things like the following example will
>         #  work.
>         #
>         #program = "/bin/echo %{User-Name}"
>         program = "/etc/raddb/xxxx.pl %{User-Name}"
>         #
>         #  The attributes which are placed into the
>         #  environment variables for the program.

Why not use perl module for perl scripts?

> And I add this module into the authorize section after the pap module.
> But it does not call the script.

pap should be listed last - put it before. So what does it do? Post the
debug.

> Another thing, if I call the script like the following, then the script is
> executed and takes myusername as an argument. With freeradius it should to
> automatically the same?

Yes. But perl module already makes all request attributes available in
$RAD_REQUEST and it should run perl scripts faster than exec module.

Ivan Kalik
Kalik Informatika ISP




More information about the Freeradius-Users mailing list