How to get current datetime in freeradius?

Houman houmie at
Tue Oct 1 08:45:23 CEST 2019


Is there a way to get the current date and time in
I checked man unlang but couldn't find anything.

What I'm trying to achieve is if Now() > Expires-At then disconnect the

preacct {
    update request {
                Expires-At = "%{sql:SELECT expires_at FROM main_db.`user`
WHERE main_db.`user`.username ='%{User-Name}'}"
        if ("%{Now()}"} > Expires-At) {
                update disconnect {
                        &User-Name = "%{User-Name}"

Many Thanks,

More information about the Freeradius-Users mailing list