Re: Unlang policy to remove duplicate attributes from reply?

tach yon <[email protected]>
Newsgroups gmane.comp.freeradius.user
Message-ID <PA4PR03MB6974AC8B44FF309B22996726987BA@PA4PR03MB6974.eurprd03.prod.outlook.com>
Hi Alan,

Thanks very much for your help!

>    update {
>        &control:Framed-IP-Address := &reply:Framed-IP-Address[0]
>        &reply:Framed-IP-Address !* ANY
>        &reply:Framed-IP-Address := &control:Framed-IP-Address
>     }

This worked great, thanks! Gosh it was driving me nuts last night, looks straightforward when you know how, thanks again 🙂


> Huh?  There's no comma after the cast statement.  Plus, the cast documentation says that casting is done via <>, and not ().  See "man unlang", or the online documentation.

I tried with both <> and (), because google was pulling out examples of both. I have no idea why freeradius would be saying it expected a comma either. I tried so many things and got various different errors. I didn't make sense to me, I dunno.

Perhaps a big part of the confusion, was that I was working on docs for version 3.0, which doesn't have a lot of info version 4.x docs has.

I realise now I should have relied more on "man unlang", sorry 🙁 It seems as so many docs are online now-a-days, it's become natural to use a browser for checking docs, and terminals for writing / modifying code.


>  Do read "man unlang" and the documentation on the web site.  Don't use third-party web sites.  Don't use AI.

After the best part of the day and continuing into the night. A seemingly unending cycle of reading/trial/error, plus trying newer freeradius versions, yeah... I did eventually realise Google and the AIs weren't making any sense. For other languages like python, google and the AIs are surprisingly good; but a less widely used language like unlang, you're right, nothing works 😕 I guess it was at that point I realised I needed real help from humans - with proper examples of what syntax can and can't be used together, hehe.

Thanks again! 🙂
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.