Hello,
Right now I have a reset configuration script wich is working if i use it to reset the mikrotik router. I wanted to add two scripts wich should be automaticly in the router if I reset it with my reset configuration script. My problem is that it doesn’t work with the added script. I couldn’t connect with the Router and had to use the default reset. What is wrong with the following code:
My Code is already working the way it should work. Just wanted to add it in the reset configuration script.
With the command ":local myCon do={:put "container";:return}" the terminal looks like this :
[admin@DISE_LAB11] /system/script> run container-run
container
value:
There i just give the number of a container i want to run. As example container number "0". And with the second line it gives the input to the variable $containerlist wich will be getting used in the following commands
Thank you for helping me.
Now I have another problem where maybe you or someonelse could help me. If i write the following code in Terminal everthing seems to be normal.
This is a rude answer, if you were that good you didn't ask for help.
I understood that they had to be scripts that had to be executed during the reset, not interactive scripts to be kept ready for later use from the terminal.
Here is the reason for the question.
I already know what the code do:
(I could also assume that where you copied the code from, it was inspired by my function, or that you copied it yourself)
Without deep inspecting the rest, missing all \ before $
As I have already written, you are not able to convert "by hand" the script to script inside the "add script" function,
so first insert them from winbox and then export them, and maybe they are correct.
this is very old (October 2024) but did you make it work? /container add in a system script? I just posted this. Spent a full day and could make it work. Containers in RAM on hEX Refresh