unlang & expr

petr.linke at seznam.cz petr.linke at seznam.cz
Fri May 18 13:54:37 CEST 2018


Hi Alan,
thank you, works as expected :).

Have a nice weekend, Petr

---------- Original e-mail ----------
From: Alan DeKok <aland at deployingradius.com>
To: FreeRadius users mailing list <freeradius-users at lists.freeradius.org>
Date: 18. 5. 2018 13:29:26
Subject: Re: unlang & expr 
"On May 18, 2018, at 7:20 AM, <petr.linke at seznam.cz> <petr.linke at seznam.cz> 
wrote:
> I need do some arithmetic operation in the soh-server, so I tried use the 
> expr module.
> 
> example:
> server soh-server {
> ...
> update control {
> &Tmp-Integer-1 := %{expr: 1 + 2 + 3}
> }
> 
> But from syntax checker I received error message: "Syntax error: Expected 
> comma after '%{expr:': 1 + 2 + 3}"
> 
> Is possible use expr in this case?

Yes.

The %{...} syntax is for *string* expansions. So you need to do use strings:

&Tmp-Integer-1 := "%{expr: 1 + 2 + 3}"
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.
html"


More information about the Freeradius-Users mailing list