Page 1 of 1

Scripting help

Posted: Sat Oct 17, 2020 12:12 am
by forgeam
I am completely new to scripting anything in Mikrotik outside the easy one-liners.

I am trying to get the IMEI of a device, save it to a variable (correct term? Or is it a string?) and then output the IMEI as a password later in the script.

I have figured out that the following lines will output the IMEI, but I don't know where to go from there?
put [interface lte info lte1 once as-value ]
put ([interface lte info lte1 once as-value ]->"imei")

Can anyone help with this?

Re: Scripting help

Posted: Mon Oct 19, 2020 10:03 am
by Lelik200
:local imei
:set imei ([/interface lte info lte1 as-value once]->"imei")
:put ("all imei number: $imei")
:put ("first 3 digit: $[:pick $imei 0 3]")

Re: Scripting help

Posted: Mon Oct 19, 2020 7:28 pm
by forgeam
This is perfect. Thank you!