Community discussions

MikroTik App
 
LoneRager
newbie
Topic Author
Posts: 41
Joined: Wed Nov 06, 2019 3:32 pm

Script to access lte1 enbID and run another script depending on the value

Wed Dec 13, 2023 8:52 pm

I am trying to write a script that grabs the enbid of lte1 and then if that value equals "1234" (or whatever value I specify) it will trigger a script called "cell_lock"

Here is what I have so far.

A schedule that runs this:
interface/lte/monitor 0 once file=cell_mon_ouput.txt
Then this script that runs every 5 minutes:
:local fileContents [/file get cell_mon_output.txt contents]
:if (:find $fileContents = "1234" = -1 ) do={
  :log info "Target value not found."
  # Add actions for scenario where value is not present (e.g., log a message)
} else={
  :system/script/ run cell_lock
}
The problem Im having is that "cell_lock" runs every time even if "1234" does not exist.

What Im I doing wrong? Thank you for taking the time to read and consider this!

Who is online

Users browsing this forum: No registered users and 4 guests