Community discussions

MikroTik App
 
tomahawk
just joined
Topic Author
Posts: 4
Joined: Tue Oct 24, 2023 9:29 am

Script run in another script

Mon Dec 11, 2023 5:00 pm

If I run one script in another script, the first main script stops working if there are syntax errors in the second script. But then how can I check whether the script has run successfully or not, if the script through which I run another script also stops working in case of failure
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12014
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Script run in another script

Mon Dec 11, 2023 5:26 pm

Just write the scripts correctly, as it should be done, that is, the script itself must prevent errors.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19405
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Script run in another script

Mon Dec 11, 2023 6:20 pm

This reminds me of the monty python sketch, "the lost world of Roiurama" but the best part of the skit is........ who is filming us now??

https://www.youtube.com/watch?v=rX2rHJg30xA
 
optio
Long time Member
Long time Member
Posts: 675
Joined: Mon Dec 26, 2022 2:57 pm

Re: Script run in another script  [SOLVED]

Mon Dec 11, 2023 6:27 pm

I agree on above replies, but to answer OP question
:do {
  /system/script/run script-with-syntax-errors
} on-error={
  :put "script run error"
}

P.S.
Not related to this topic, my favorite MP scene which always comes to my mind on my job when incompetent people defines how something works https://www.youtube.com/watch?v=H9PY_3E3h2c

Who is online

Users browsing this forum: No registered users and 5 guests