[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Shutdown computer after a specific command has been executed



On 12/09/2013 01:42 PM, Muntasim-Ul-Haque wrote:
> Hi,
> I need a tool that would make sure that, my computer would shutdown
> after a specific command has been executed. This tool would just wait
> for the Terminal for executing a command, like '/sudo apt-get upgrade/'
> and then after the command has been executed, my computer would
> shutdown. Is that possible? Is there a tool or anything out there that
> can do this for me? Let me know. It would be of great help. Thanks in
> advance.
> Muntasim-Ul-Haque


This would do it, but only if apt succeeds:

	sudo apt-get upgrade && sudo shutdown -h now

If you want it shut down regardless of the outcome of apt, then this
should do it:

	sudo apt-get upgrade; sudo shutdown -h now

regards,
/Lars


Reply to: