How to get current datetime in freeradius?

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


Hello,

Is there a way to get the current date and time in
/etc/freeradius/3.0/sites-enabled/default?
I checked man unlang but couldn't find anything.

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

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,
Houman


More information about the Freeradius-Users mailing list