I have a task to school to create a script for cleaning RouterOS configuration on start up.
I found how to make reset “/system reset-configuration” but i really didnt know how to setup this on RouterOS start up.
Is there way to create a script like “/system script add name=calen” and put into this script reset-configuration commend ?
Beware, the below code will reset all of your configuration on the next startup.
/system script add name=calen source={/system reset-configuration}
/system scheduler add name=calen on-event=calen start-time=startupIt’s very basic and you should be able to make a script like this by just reading through https://wiki.mikrotik.com/wiki/Manual:Scripting and https://wiki.mikrotik.com/wiki/Manual:System/Scheduler
Isn’t the idea of school to let you learn something? If you just copy someone’s script, it is actually plagiarism and schools don’t like that.
Way how you should think:
config reset ALWAYS cause reboot.
any config will get removed after you reset config (including script for another config reset)
config reset has a parameter “run-after-reset” which allows you to run RSC script saved in storage (careful - if you save script in memory, it will get also wiped out after any reboot)
if you put another config reset into your RSC, you will end up in bootloop because after reset it will reboot, run another reset and again reboot
what you really want to do is write RSC which will ADD scheduled script for config reset . That way, it will do reset, reboot, apply script and wait for reboot which will launch another reset, which will cause reboot, application of script and again waiting for reboot.
Feel free to submit your script drafts. I am sure folks around will not mind to point out mistakes or confirm that it is correct. But do not expect that people will do your homework.