28 Sep
2017
28 Sep
'17
5:57 p.m.
On Sep 28, 2017, at 3:50 PM, Ti Ti <tt91em@gmail.com> wrote:
Hello, I'm using unlang to discriminate the database to use as described in the code below. Is there a method to use variables so avoid the redundant check of NAS-Id?
You can't mix multiple regular expressions and get multiple different outputs. The regular expression libraries don't allow it. If you want to use the same set of "if" statements in multiple places, use policies. Add raddb/policy.d/check-nas-id, and put this into it: policy check-nas-id { if (&NAS-Identifier =~ /test/i) { db1 } if (&NAS-Identifier =~ /test2/i) { db2 } } Then everywhere you need that set of "if" statements, just use: check-nas-id Alan DeKok.