ENV variables in external scripts

rsg ranil.santhish at gmail.com
Fri Mar 7 16:37:00 CET 2008


Well.. What I meant was I actually would like to call an environmental
variable as a variable in my simple perl script.

Following "Attributes as environment variables in executed programs"
in variables.txt for instance I tried the below.
---------------------------------------
#!/usr/bin/perl -w
use Mysql;

$Check = $CALLING_STATION_ID;

print STDERR "\t: $Check\n";

$db = Mysql->connect("localhost","radius","root","");
$status = $db->Mysql::query("select if((select CallingStationId from
radcheck where CallingStationId='$Check' order by Id limit
1),'y','n')");
($chk)= $status->FetchRow();
print STDERR "\t: $chk\n";

if($chk eq 'n'){
exit 255;
}
--------------------------------------------------

But I see nothing for the -> print STDERR "\t: $Check\n"; which should
ideally give the Calling-Station-Id.

And the Sql check obviously gives "n".


P.S.  In the context, I have nothing that I cannot share with you. So
my apologies if I sounded so, in my previous mail.

Thanks for your help,





On Fri, Mar 7, 2008 at 4:07 PM, Alan DeKok <aland at deployingradius.com> wrote:
> rsg wrote:
>  > I unsuccessfully attempted the options given by ../docs/variables.txt.
>  > Please help with the correct syntax.
>
>  Q: I won't tell you what I did, or what happened when I did it, but I
>  need to know why it doesn't work.
>
>  A: Damned if I know.
>
>   Alan DeKok.
>  -
>  List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>



More information about the Freeradius-Users mailing list