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,
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.
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…)