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

Re: Shutdown computer after a specific command has been executed



On Thu, 2013-12-12 at 14:58 +0100, Gian Uberto Lauri wrote:
> Osamu Aoki writes:
>  > But I want one line solution :-)
>  > 
>  >  sudo sh -c "apt-get update && apt-get upgrade; shutdown -h now"
> 
> But there is the case where apt-get want a reply for the user and that
> is 'N' :) !! Baka!!! :)

apt-get upgrade will ask the user to upgrade or not and that is wanted,
assumed the update was successful. This line is ok, I just have doubts
if there is anything less good with using sudo sh, I will ask detailed
about it in some minutes, since I have to reboot first.


Reply to: