Community discussions

MikroTik App
 
User avatar
sjoram
Member Candidate
Member Candidate
Topic Author
Posts: 187
Joined: Sun Feb 10, 2013 8:47 pm
Location: Essex, UK

Script not working in ROS7

Tue Nov 15, 2022 2:38 pm

I am setting up a new router from scratch which I've upgraded to the latest v7 stable.
I've copied a script out of my existing ROS v6 which works fine there. Under v7, it appears not to running at all.
If the commands are run manually in terminal, they work fine.
All permissions are selected on the script and don't require permissions is ticked.

Script is below and as noted works with ROSv6 and if run from terminal on v7.
Both working v6 and not working v7 devices are RB750Gr3:
/tool fetch address=<FQDN redacted> host=<FQDN redacted> mode=https src-path=/blacklists/firehol1.rsc keep-result=yes ; import firehol1.rsc ;
/tool fetch address=<FQDN redacted> host=<FQDN redacted> mode=https src-path=/blacklists/firehol2.rsc keep-result=yes ; import firehol2.rsc ;
/tool fetch address=<FQDN redacted> host=<FQDN redacted> mode=https src-path=/blacklists/firehol3.rsc keep-result=yes ; import firehol3.rsc ;
/tool fetch address=<FQDN redacted> host=<FQDN redacted> mode=https src-path=/blacklists/fireholwebclient.rsc keep-result=yes ; import fireholwebclient.rsc ;
Any ideas?
Last edited by sjoram on Thu Nov 17, 2022 12:38 am, edited 1 time in total.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Script not working in ROS7

Wed Nov 16, 2022 3:14 pm

.

why not write it directly as:
/tool fetch url="https://<FQDN redacted>/blacklists/firehol1.rsc"; /import file-name="firehol1.rsc"
/tool fetch url="https://<FQDN redacted>/blacklists/firehol2.rsc"; /import file-name="firehol2.rsc"
/tool fetch url="https://<FQDN redacted>/blacklists/firehol3.rsc"; /import file-name="firehol3.rsc"
/tool fetch url="https://<FQDN redacted>/blacklists/fireholwebclient.rsc"; /import file-name="fireholwebclient.rsc"
without all the frills?

The error can be inside the imported .rsc, you have to provide an example..

If this statement block is part of another script/scheduler, the error is probably the lack of / before import because it inherit the context from previous instructions.
Last edited by rextended on Thu Nov 17, 2022 1:35 pm, edited 1 time in total.
 
User avatar
sjoram
Member Candidate
Member Candidate
Topic Author
Posts: 187
Joined: Sun Feb 10, 2013 8:47 pm
Location: Essex, UK

Re: Script not working in ROS7

Thu Nov 17, 2022 12:37 am

Thanks, I'll try adding the /import
There's nothing else in the script being run by the schedule.

The script that it is downloading and importing is just a script to find and clear a firewall address list and add new dynamic entries.

There's no log entry showing the file is downloaded when called by scheduler, but is when run manually and it succeeds.

I was configuring a new router for a colleague, so I'll update once I've been able to get access and test - it's offline at the moment pending install.
 
User avatar
sjoram
Member Candidate
Member Candidate
Topic Author
Posts: 187
Joined: Sun Feb 10, 2013 8:47 pm
Location: Essex, UK

Re: Script not working in ROS7  [SOLVED]

Fri Dec 09, 2022 10:14 am

This router is back online now...
I edited the script slightly, but still didn't work. (Remove space between end of command and ; and made sure that /import started on a new line each time)
Copied the script exactly, but out into a new script, worked first time.
I can't remember if I created the script before I upgraded ROS from the factory shipped v6 version to v7, but if I did, maybe something in that.
I haven't upgraded any of my others from v6 to v7 yet, but I'll keep an eye out for whether this issue re-appears.

Who is online

Users browsing this forum: No registered users and 64 guests