Improvements to Reboot and Shutdown
-
REBOOT: It would be good to allow a scheduled one-off reboot. I would modify the reboot popup from the current version (reboot yes/no) to a new version where the pop-up presents 3 option:
- Reboot now
- Reboot in N minutes from now (this can easily mapped into a cru a command). Perhaps when booked a countdown can appear somewhere e.g. on the header of the admin page.
- Cancel
-
SHUTDOWN:
The Shutdown menu on a router is used extremely rarely and it can cause unwanted hassle if a device is shut down mistakenly. Since Shutdown lives next to reboot in the menu and the pop up page is pretty much identical amongst the two, I would modify the popup behaviour of the Shutdown function to make sure the user is warned in case a rebooted is wanted but Shutdown is selected by error. An idea would be as follow:On the pop-up where the user is requested to confirm whether to shutdown or not, if OK is selected, rather than proceed, I would make a second pop-up appearing (even in different colour to attract the user attention) asking “Are you really sure you want to shutdown this device?” and if OK is selected again then proceed.→ DONE
Comments (8)
-
reporter -
reporter I think I’ve done the GUI part of the Reboot idea detailed above.
function reboot() { var m = 0; var r = prompt("In how many minutes you want to reboot?\nuse 0 for an immediate action", "0"); if (r = 0) { m = 0; form.submitHidden('tomato.cgi', { _reboot: 1, _commit: 0, _nvset: 0 }); } else { m = r; // convert minutes delay into absolute date in the future from now // add cru a command to plan the reboot } }
Can anybody provide some inputs on what's the best way in tomato to actually execute system commands and specifically the cru a command for insertion into the crontable?
-
repo owner The 2nd part (shutdown) is ready: https://bitbucket.org/pedro311/freshtomato-arm/commits/e800537f5a61b37dbc28f9b772fdbc55e191a4c0
-
repo owner - changed status to open
-
reporter - edited description
-
repo owner - changed status to new
-
If you delay options will be minutes, consider sleep ?
Usage: sleep [N]... Pause for a time equal to the total of the args given, where each arg can have an optional suffix of (s)econds, (m)inutes, (h)ours, or (d)ays
Take into consideration nothing executes until it counts down… but then if it’s reboot, that’s likely pointless. (Of course you can always use an ampersand to background it)
sleep 1m reboot or sleep 60s reboot for example.
Should default to 0 for an immediate reboot with no additional user input.
-
repo owner - changed status to closed
I thought about it for a long time and came to the conclusion that it's not a good idea, so I won't add it.
- Log in to comment
For the Shutdown I’ve done this via a modification to the tomato.js . Removing this:
And adding this instead: