Quantcast
Channel: MikroTik
Viewing all articles
Browse latest Browse all 21284

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

$
0
0
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:
Code:
interface/lte/monitor 0 once file=cell_mon_ouput.txt
Then this script that runs every 5 minutes:
Code:
: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!

Statistics: Posted by LoneRager — Wed Dec 13, 2023 8:52 pm



Viewing all articles
Browse latest Browse all 21284

Trending Articles