Hotspot user profile: on-login script cannot use mac-address internal variable

The manual http://wiki.mikrotik.com/wiki/Manual:IP/Hotspot/User says that the on-login script is able to use internal variables:
From the manual:

List of available variables:

  • $user
  • $username (alternative var name for $user)
  • $address
  • $mac-address
  • $interface

This script works:
:log info “$address is logged on”

This script does not:
:log info “$mac-address is logged on”

Is this a bug, an error in the manual or what am I missing here?

Hi there,

Same problem here.
Any solutions?

Thank you in Advance

When variable names contain characters other than letters and numbers, they must be quoted (and can’t be used inside a string - only concatenated to one). I guess the documentation is somewhat misleading in that it doesn’t show the quotes right there in the list.

So:

:log info ($"mac-address" . " is logged on")

Thank you boen,
It really helps.

Another question,

Is there any way to log the Agent Circuit Id (Relay Agent Info) here? (On Login or On Logout Scripts)
Or we just can access to those variables in the document. (?)

Thank you in Advance