How to reset Mikrotik via a script from the scheduler or from scripts or terminal /system reset-configuration
/system reset-configuration