hotspot new active

Hi guys and still happy new MT year everybody!

i create this script:


/export file=email
/tool e-mail send
to=“abc@def.com” from=abc@def.com
subject=“new user connected” body=“$[/ip hotspot active get value-name=user number=0]”
server=10.20.30.40

and in IP → HOTSPOT → USER PROFILES i add

/system script run mail

on “scripts” menù, ON LOGIN

it works fine for me, but it get only value-name first on the list (number=0)

so each time, when i have another logged user i “grep” always the same user value.
My purpose is to grep correct value username each time

anyone helps me to correct that?


Thx guys!
A

As already written two thousand and twenty-four times, number= (and related) must absolutely never be used in scripts.

Hint: Read the documentation:
https://wiki.mikrotik.com/wiki/Manual:IP/Hotspot/User#User_Profile

I fixed it using the little hint :wink:

P.S. i made all by “on login” menù using :tool/email ecc…

thx for the tip rextended