Good feature: add run-after-reboot option in /system/reboot
Syntax:
/system/reboot run-after-reboot={<command>};
Sometimes you may need to execute a one time command after this reboot.
For certain situations, quick command execution is essential.
This can be crucial for tasks like disk management configuration, where you need to run commands faster than typical startup processes.
Please don’t be negative. If you like this topic/post, leave a comment u[/u].
Except for “run this only after next restart”, wouldn’t scheduler entry with “start-time=startup” and without setting “interval” do the trick?
The problem with running commands “as quickly as possible” can be that hardware might not be fully initialized at the time that command gets executed and would thus fail. E.g. network might not be up&running yet, so many users do include a “:delay 10” (or something) to the beginning of the script just to make sure router is fully booted before doing anything essential.
You are right, and you can add a delay inside curly parentheses, like run-after-reboot={:delay 3s; };
I am talking about the case that there is a command that I want to execute only once, without resorting to creating a schedule, nor will I use it again.
What you are suggesting is a relatively minor quality-of-life feature. Functionality wise it is already entirely possible to do.
Scheduler and scripts can also delete themselves when executing so that solves your ‘run once’ problem and it will clean itself up
So you just need to build a small config template, write your desired commands in the middle then paste it into the router
I’m not sure criticality, or need, myself… it’s a “/system/schedule add …” with one extra line in script to “/system/schedule/remove [find name=run-after-reboot]”, as noted.
Schedulers also have enable/disable feature. Startup scheduler can be created where last command disables itself, when needed to run once on boot, edit command(s) above last command, enable scheduler and reboot.