Re: Shutdown computer after a specific command has been executed

2013-12-13 Thread Andrei POPESCU
On Jo, 12 dec 13, 16:15:44, Ralf Mardorf wrote: On Thu, 2013-12-12 at 16:10 +0100, Ralf Mardorf wrote: sudo sh -c apt-get update apt-get dist-upgrade -y ; poweroff sudo sh -c apt-get update apt-get dist-upgrade --dry-run ; apt-get dist-upgrade -y ; poweroff -y without a dry run :S,

Re: Shutdown computer after a specific command has been executed

2013-12-13 Thread Ralf Mardorf
On Fri, 2013-12-13 at 11:07 +0200, Andrei POPESCU wrote: Simple: sudo sh -c apt-get update apt-get --download-only -y dist-upgrade ; poweroff and do the upgrade the next day, under human supervision. +1 Perhaps then directly sudo sh -c apt-get update ; apt-get --download-only -y

Re: Shutdown computer after a specific command has been executed

2013-12-13 Thread Ralf Mardorf
On Fri, 2013-12-13 at 14:28 +0100, Ralf Mardorf wrote: On Fri, 2013-12-13 at 11:07 +0200, Andrei POPESCU wrote: Simple: sudo sh -c apt-get update apt-get --download-only -y dist-upgrade ; poweroff and do the upgrade the next day, under human supervision. +1 Perhaps then

Re: Shutdown computer after a specific command has been executed

2013-12-12 Thread Osamu Aoki
Hi, On Mon, Dec 09, 2013 at 02:38:45PM +0100, Ralf Mardorf wrote: One way would be to use a script that runs e.g. apt-get and then the shutdown command. #!/bin/sh apt-get update apt-get upgrade shutdown -h now # or poweroff or halt If you want it shut down regardless of the outcome of

Re: Shutdown computer after a specific command has been executed

2013-12-12 Thread Gian Uberto Lauri
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!!! :) -- /\ ___Ubuntu: ancient

Re: Shutdown computer after a specific command has been executed

2013-12-12 Thread Ralf Mardorf
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

Re: Shutdown computer after a specific command has been executed

2013-12-12 Thread Gian Uberto Lauri
Ralf Mardorf writes: 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

Re: Shutdown computer after a specific command has been executed

2013-12-12 Thread Ralf Mardorf
On Thu, 2013-12-12 at 15:33 +0100, Gian Uberto Lauri wrote: Sorry, it may ask if it has to preserve or not a configuration file modified locally when a new version arrives with the package. Good point, I don't use apt that often, because my main distro isn't Debian. I guess there's an option to

Re: Shutdown computer after a specific command has been executed

2013-12-12 Thread Gian Uberto Lauri
Ralf Mardorf writes: On Thu, 2013-12-12 at 15:33 +0100, Gian Uberto Lauri wrote: Sorry, it may ask if it has to preserve or not a configuration file modified locally when a new version arrives with the package. Good point, I don't use apt that often, because my main distro isn't

Re: Shutdown computer after a specific command has been executed

2013-12-12 Thread Reco
Hi. On Thu, 12 Dec 2013 14:58:35 +0100 Gian Uberto Lauri sa...@eng.it 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' :) !!

Re: Shutdown computer after a specific command has been executed

2013-12-12 Thread Ralf Mardorf
On Thu, 2013-12-12 at 18:57 +0400, Reco wrote: sudo sh -c apt-get update apt-get upgrade -y poweroff That's more like it. Depending on a hardware, 'shutdown -h now' can leave the power on. :D We are close to solve it :D. apt-get upgrade -y poweroff if the

Re: Shutdown computer after a specific command has been executed

2013-12-12 Thread Ralf Mardorf
On Thu, 2013-12-12 at 16:10 +0100, Ralf Mardorf wrote: sudo sh -c apt-get update apt-get dist-upgrade -y ; poweroff sudo sh -c apt-get update apt-get dist-upgrade --dry-run ; apt-get dist-upgrade -y ; poweroff -y without a dry run :S, OTOH, the OP want's to go to sleep, so the dry-run first

Re: Shutdown computer after a specific command has been executed

2013-12-12 Thread Reco
On Thu, 12 Dec 2013 16:10:44 +0100 Ralf Mardorf ralf.mard...@alice-dsl.net wrote: On Thu, 2013-12-12 at 18:57 +0400, Reco wrote: sudo sh -c apt-get update apt-get upgrade -y poweroff That's more like it. Depending on a hardware, 'shutdown -h now' can leave the power on. :D We are

Re: Shutdown computer after a specific command has been executed

2013-12-12 Thread Ralf Mardorf
On Thu, 2013-12-12 at 19:17 +0400, Reco wrote: Still, if one has desire to blow legs off: :D sudo sh -c apt-get update apt-get upgrade -y ; poweroff but I would recommend sudo sh -c apt-get update apt-get dist-upgrade -y ; poweroff -- To UNSUBSCRIBE, email to

Re: Shutdown computer after a specific command has been executed

2013-12-12 Thread Ralf Mardorf
On Thu, 2013-12-12 at 16:21 +0100, Ralf Mardorf wrote: On Thu, 2013-12-12 at 19:17 +0400, Reco wrote: Still, if one has desire to blow legs off: :D sudo sh -c apt-get update apt-get upgrade -y ; poweroff but I would recommend sudo sh -c apt-get update apt-get dist-upgrade -y ;

Re: Shutdown computer after a specific command has been executed

2013-12-12 Thread Reco
On Thu, 12 Dec 2013 16:21:34 +0100 Ralf Mardorf ralf.mard...@alice-dsl.net wrote: On Thu, 2013-12-12 at 19:17 +0400, Reco wrote: Still, if one has desire to blow legs off: :D sudo sh -c apt-get update apt-get upgrade -y ; poweroff but I would recommend sudo sh -c apt-get update

Shutdown computer after a specific command has been executed

2013-12-09 Thread Muntasim-Ul-Haque
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

Re: Shutdown computer after a specific command has been executed

2013-12-09 Thread Lars Noodén
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

Re: Shutdown computer after a specific command has been executed

2013-12-09 Thread Ralf Mardorf
On Mon, 2013-12-09 at 17:42 +0600, 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

Re: Shutdown computer after a specific command has been executed

2013-12-09 Thread Philip Ashmore
On 09/12/13 11:42, 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

Re: Shutdown computer after a specific command has been executed

2013-12-09 Thread Gian Uberto Lauri
Muntasim-Ul-Haque writes: 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

Re: Shutdown computer after a specific command has been executed

2013-12-09 Thread Ralf Mardorf
On Mon, 2013-12-09 at 13:02 +, Philip Ashmore wrote: but I think sudo has a timeout sudo -i and then run a script, if you not explicitly configured it to have a timeout it has got no timeout. -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe.

Re: Shutdown computer after a specific command has been executed

2013-12-09 Thread Karl E. Jorgensen
Hi On Mon, Dec 09, 2013 at 05:42:17PM +0600, 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

Re: Shutdown computer after a specific command has been executed

2013-12-09 Thread Ralf Mardorf
On Mon, 2013-12-09 at 13:11 +, Karl E. Jorgensen wrote: Hi On Mon, Dec 09, 2013 at 05:42:17PM +0600, 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

Re: Shutdown computer after a specific command has been executed

2013-12-09 Thread Ralf Mardorf
On Mon, 2013-12-09 at 14:16 +0100, Ralf Mardorf wrote: On Mon, 2013-12-09 at 13:11 +, Karl E. Jorgensen wrote: Hi On Mon, Dec 09, 2013 at 05:42:17PM +0600, Muntasim-Ul-Haque wrote: Hi, I need a tool that would make sure that, my computer would shutdown after a specific

Re: Shutdown computer after a specific command has been executed

2013-12-09 Thread Ralf Mardorf
On Mon, 2013-12-09 at 14:10 +0100, Gian Uberto Lauri wrote: If you execute command as root (better than using sudo) you can either issue from the # prompt Andrei already pointed out on another thread how to use sudo and I repeated it for this thread. You can configure su to have a timeout too,

Re: Shutdown computer after a specific command has been executed

2013-12-09 Thread Ralf Mardorf
On Mon, 2013-12-09 at 14:48 +0200, Lars Noodén wrote: 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 Wrong, if the upgrade should take to long, then you need to type the password after the upgrade. Better

Re: Shutdown computer after a specific command has been executed

2013-12-09 Thread Lars Noodén
On 12/09/2013 03:30 PM, Ralf Mardorf wrote: On Mon, 2013-12-09 at 14:48 +0200, Lars Noodén wrote: 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 Wrong, if the upgrade should take to long, then you need

Re: Shutdown computer after a specific command has been executed

2013-12-09 Thread Ralf Mardorf
On Mon, 2013-12-09 at 15:34 +0200, Lars Noodén wrote: On 12/09/2013 03:30 PM, Ralf Mardorf wrote: On Mon, 2013-12-09 at 14:48 +0200, Lars Noodén wrote: 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

Re: Re: Shutdown computer after a specific command has been executed

2013-12-09 Thread Muntasim-Ul-Haque
Thanks Lars, Mardorf, Ashmore, Lauri and Jorgensen for your advice. I needed it badly and your advice showed me the way. Thanks a lot. To Jorgensen: I'm a Broadband Internet user and I'm billed for the time my Internet connection is active. Sometimes it happens that I've a large software to

Re: Re: Shutdown computer after a specific command has been executed

2013-12-09 Thread Gian Uberto Lauri
Muntasim-Ul-Haque writes: To Jorgensen: I'm a Broadband Internet user and I'm billed for the time ... command and go to sleep. If the command execution completes and the Internet is still on, then it would be a waste of my Internet. That's why I needed a command that would shutdown the

Re: Re: Shutdown computer after a specific command has been executed

2013-12-09 Thread Ralf Mardorf
On Mon, 2013-12-09 at 20:03 +0600, Muntasim-Ul-Haque wrote: Thanks Lars, Mardorf, Ashmore, Lauri and Jorgensen for your advice. I needed it badly and your advice showed me the way. Thanks a lot. To Jorgensen: I'm a Broadband Internet user and I'm billed for the time my Internet connection is

Re: Shutdown computer after a specific command has been executed

2013-12-09 Thread Lisi Reisz
On Monday 09 December 2013 14:03:57 Muntasim-Ul-Haque wrote: I'm a Broadband Internet user and I'm billed for the time my Internet connection is active. Sometimes it happens that I've a large software to install like the TeXworks, which is about 650MB, I think. Or, the system up-gradation, if

Re: Shutdown computer after a specific command has been executed

2013-12-09 Thread Tony van der Hoff
On 09/12/13 15:16, Lisi Reisz wrote: On Monday 09 December 2013 14:03:57 Muntasim-Ul-Haque wrote: I'm a Broadband Internet user and I'm billed for the time my Internet connection is active. Sometimes it happens that I've a large software to install like the TeXworks, which is about 650MB, I

Re: Shutdown computer after a specific command has been executed

2013-12-09 Thread yaro
On Monday, December 09, 2013 03:56:12 PM Tony van der Hoff wrote: On 09/12/13 15:16, Lisi Reisz wrote: On Monday 09 December 2013 14:03:57 Muntasim-Ul-Haque wrote: I'm a Broadband Internet user and I'm billed for the time my Internet connection is active. Sometimes it happens that I've a

Re: Shutdown computer after a specific command has been executed

2013-12-09 Thread Gian Uberto Lauri
Tony van der Hoff writes: On 09/12/13 15:16, Lisi Reisz wrote: On Monday 09 December 2013 14:03:57 Muntasim-Ul-Haque wrote: I'm a Broadband Internet user and I'm billed for the time my Internet connection is active. Sometimes it happens that I've a large software to install like the

Re: Re: Shutdown computer after a specific command has been executed

2013-12-09 Thread Muntasim-Ul-Haque
Thank you everyone for joining me in this conversation. And sorry, my Internet wasn't Broadband. It's Dial-up indeed. Now, in a nutshell, what I have, is a command that would do the job for me, no matter how long it takes to execute the command. The following could be considered as an example: