Using configuration items in strings

Arran Cudbard-Bell a.cudbardb at freeradius.org
Fri Feb 14 17:29:45 CET 2014


On 14 Feb 2014, at 16:06, Caines, Max <Max.Caines at WLV.AC.UK> wrote:

> Hi
> 
> I'm trying to make some of my configuration dependent on whether I've configured SQL, so I can create an easy way to turn off all use of SQL by our servers (we don't have a cluster, and we don't use the SQL server for authentication, so if it went down, we could do without it for a bit). I've used an "if" statement testing "%{config:modules.sql.server}", which I expected to give me the value "NPS" if I had set the value and null otherwise. That way I thought I could just comment out the "$INCLUDE mssql.conf" in radius.conf, and the "sql" in the "instantiate" section (we are only using SQL in "xlat" expressions) and avoid the "xlat" expressions being evaluated. However, it looks like whether I include "mssql.conf" or not, that expression always evaluates to "localhost". I'm baffled. Should this work? I got this expression format from https://github.com/FreeRADIUS/www.freeradius.org/blob/master/radiusd/doc/variables.txt. 

Yes that should work. Weird.

Could you see if 

if ("${modules.sql.server}" == 'NPS') {

}

Is any better?

-Arran

Arran Cudbard-Bell <a.cudbardb at freeradius.org>
FreeRADIUS Development Team

FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 881 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20140214/3775fd67/attachment.pgp>


More information about the Freeradius-Users mailing list