Community discussions

MikroTik App
 
forgeam
just joined
Topic Author
Posts: 2
Joined: Sat Oct 17, 2020 12:09 am

Scripting help

Sat Oct 17, 2020 12:12 am

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?
 
Lelik200
just joined
Posts: 22
Joined: Fri Jul 24, 2020 1:48 pm

Re: Scripting help

Mon Oct 19, 2020 10:03 am

: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]")
 
forgeam
just joined
Topic Author
Posts: 2
Joined: Sat Oct 17, 2020 12:09 am

Re: Scripting help

Mon Oct 19, 2020 7:28 pm

This is perfect. Thank you!

Who is online

Users browsing this forum: Lelik200, vibhupandey and 25 guests