Script for OVPN users

Hi,
I need Script on my MikroTik server for checking connected OVPN users and remove any OVPN users that its uptime more than 1 Minute but Tx is 0.
Something like this:
int ovpn-server remove [find uptime>00:01:00 Tx=0]
but above script doesn’t work!
anyone can help?
Thanks,

Tx not exist.

What about "Tx Bytes" ?

I do not use OVPN.
On terminal paste this, using one OVPN real interface name

:put [/interface get <ovpn-test>]

Search on results how the wanted field are called, for example “…;tx-byte=541654;…”.

Replace tx-byte on following script with the corect name:
/interface ovpn-server remove [find where ((uptime > 00:01:00) and ([/interface get $name tx-byte] = 0))]If you use this on scripts, DO NOT DECLARE any variable called “name” on the script…

I can not test it, so no warranty that works,
but is nice if you write is work or not for other users.

You test the script?

[admin@MikroTik] > :put [/interface get ]
.id=*f00e1b;actual-mtu=1400;disabled=false;dynamic=true;fp-rx-byte=0;
fp-rx-packet=0;fp-tx-byte=0;fp-tx-packet=0;last-link-up-time=mar/01/2
023 23:19:14;link-downs=0;mtu=1500;name=;running=true;
rx-byte=594633;rx-drop=0;rx-error=0;rx-packet=3255;tx-byte=11926821;t
x-drop=0;tx-error=0;tx-packet=10736;tx-queue-drop=0;type=ovpn-in

it seems there is no "uptime" (online duration) field!

It doesn’t matter, matter only the existance of “tx-byte”.
You don’t have to change that parameter there, try the script (if any is blocked, obviously do not return anything if all is ok…)

/interface ovpn-server remove [find where ((uptime > 00:01:00) and ([/interface get $name tx-byte] = 0))]

with above command nothing happened but the following command seems to remove any user with tx-byte=0 :

/interface ovpn-server remove [find where ([/interface get $name rx-byte] = 0)]

I need more test for the exact result ....

I can not test it because do not have OVPN ,as I already wrote,

but you put Rx- on script not Tx-…

Thank you @rextended,

/interface ovpn-server remove [find where ([/interface get $name rx-byte] = 0)]

Solved my problem.