Problem with using Netinstall

Hey!

For a project that I’m working on I have to install default configuration script onto hEX S routers, now I did this once by following the mikrotiks manual, by checking “configure script” and choosing the script . While this did change the default script, that default script didn’t work, the only way I could access it was via WinBox, after fixing up the script a bit, and trying to do the same procedure with Netinstall, the default script on the hEX doesn’t change.
I’ve made sure that the scripts configurations are correct by putting them in a different script and using it with

import foo.rcs

it worked like it’s supposed to. But I need the default script to work, so that if our customers mess something up, they can just reset routerOS to our default configuration. Also I did make sure that “protected-routerboot” is disabled.

So if anyone has an idea what could be wrong, and how to fix it, I’d be really thankful.

You mean after reset it loads your script successfully but at the same time there are left overs from the default script ?

The way I’m interpreting this question is: he has a custom default configuration he wants to impose with netinstall, and the script he created works when he invokes it by hand, but it doesn’t work when invoked automatically at router reboot/reset-configuration time. If this isn’t correct, apologies.

You should examine the factory default initialization script: /system default-configuration script print. You will see a whole bunch of code in there that spins waiting for interfaces to appear and to show up ready, among other things. You need to adopt the same code.

This is a primary cause of the syndrome where a script works fine by hand, but fails at startup – by the time you run it by hand, all the interfaces are ready to go, which is not the case at actual device boot time.