Community discussions

MikroTik App
 
seanet
newbie
Topic Author
Posts: 35
Joined: Fri Mar 01, 2013 11:26 pm

LTE Network mode check

Thu Jan 30, 2020 1:48 pm

Hi
i want to create script to do some actions after checking lte interface network mode
For example if "gsm,3g,lte" is checked do /beep

but it does't work correctly.but i don't know why ?
:global a
/interface lte print once do={
  :set a $network-mode
  }
:if ($a = "gsm,3g,lte") do={
  :beep frequency=50 length=2
  }
 
User avatar
SiB
Forum Guru
Forum Guru
Posts: 1314
Joined: Sun Jan 06, 2013 11:19 pm
Location: Poland

Re: LTE Network mode check

Fri Jan 31, 2020 1:15 am

first try your command in CLI, just in terminal to discover that print and once are not existing together. Use TAB key in CLI.
Next with working one command build more complex structure. Use simple commands as possible.

put [interface lte get lte1 network-mode ]
lte
if (1=1) do={put OK} else={put NOK}
OK
if ([interface lte get lte1 network-mode ] = "lte") do={put OK} else={put NOK}
OK
if ([interface lte get lte1 network-mode ] = "lte") do={/system script run music}

And bonus:
Beeps are for play a music "Star Wars -- The Imperial March" or "A_Bit_of_Sounds"
MTCNA + MTCRE + MTCINE | ~600 users at ~150 RouterBoards in EMEA | Telegram: @SiB_PL
WinBox Tip: F6 works as ALT+TAB | Gliffy.com - free network schematic | prnt.sc - free ScreenShot software
At vacation until 15.jan.2021
 
seanet
newbie
Topic Author
Posts: 35
Joined: Fri Mar 01, 2013 11:26 pm

Re: LTE Network mode check

Sat Feb 01, 2020 8:33 am

:)
thanks Sir
i will try :D
 
scarletmichelle
just joined
Posts: 1
Joined: Wed Dec 30, 2020 9:10 am
Location: New York
Contact:

Re: LTE Network mode check

Wed Dec 30, 2020 9:15 am

first try your command in CLI, just in terminal to discover that print and once are not existing together. Use TAB key in CLI.
Next with working one command build more complex structure. Use simple commands as possible.

put [interface lte get lte1 network-mode ]
lte
if (1=1) do={put OK} else={put NOK}
OK
if ([interface lte get lte1 network-mode ] = "lte") do={put OK} else={put NOK}
OK
if ([interface lte get lte1 network-mode ] = "lte") do={/system script run music}

And bonus:
Beeps are for play a music "Star Wars -- The Imperial March" or "A_Bit_of_Sounds"
Your music is great, I like it and can I download it ???
World ringtones for your mobile phone.

Who is online

Users browsing this forum: No registered users and 41 guests