I am using Ubuntu 14.04 and looking for updating an script to allow passwordless powering off my machine after executing set of commands.
To do so, I have configured sudo shutdown now
and it does the jop. However, my question is
How to update that command so that it prompts me an option choice ( y / n ) with timeout ? ...to choose whether to shutdown now or not. If no answer is provided after the time is out then shutdown.
now
accepts any more parameters. Instead you can think about adding+m
(i.e minutes) after which the system will shutdown (and you can cancel with ctrl+c)