You are not logged in.

#1 2007-06-01 16:08:47

fiod
Member
Registered: 2007-04-02
Posts: 205

Convenience question

Hey,

Suppose I started a full system upgrade (by typing pacman -Syu at the shell),
and now I want somehow to add an order to reset/shutdown my computer at the end of
the upgrading process (similar to typing 'pacman -Syu ; init 6').

Is there some way to add this instruction AFTER the beginning of the upgrade process?

Tnx
Fiod

Offline

#2 2007-06-01 17:13:57

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: Convenience question

I think this should work:

Ctrl-Z
wait; init 6

It might need to be this, I'm not totally sure:

Ctrl-Z
wait $!; init 6

Last edited by Ramses de Norre (2007-06-01 17:15:16)

Offline

#3 2007-06-01 18:09:06

samlt
Member
Registered: 2007-05-20
Posts: 18

Re: Convenience question

problem is that ^Z will pause the process, and AFAIK 'wait $?' will not resume it, so you could do

^Z
fg && init 6

if you want the computer not to shutdown in case of an error
or

^Z
fg ; init 6

in case you just don't care

Last edited by samlt (2007-06-01 19:04:19)

Offline

#4 2007-06-01 18:27:38

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: Convenience question

Does ctrl-Z pause the application? If that's so you don't want to use my code, I thought ctrl-Z just backgrounded the previous command...

Offline

#5 2007-06-01 19:12:44

mitsoko
Banned
From: In the Coal Chamber
Registered: 2007-05-08
Posts: 143

Re: Convenience question

this should work; sorry can't shutdown now , pc is busy .. but a simple echo worked, so init shoudl work as well ( it failed in the pass, but i know why)

pacman -Syu && init 6 || init 6

you might wanna add the --noconfirm option/ tells pacman to just choose the default option if a question is asked;
and f (as-in Syuf) to force overwrite files if conflicts arise, it might be dangerous but in my experience, it's never caused a problem ..
&& - and
|| - or

use both so it reboots irrespectively of the result. ( reboot even if it fails)

Offline

#6 2007-06-01 19:36:23

samlt
Member
Registered: 2007-05-20
Posts: 18

Re: Convenience question

pacman -Syu && init 6 || init 6

why making things so complicated.. if you don't care about the pacman return code then, as I said above, just ignore it!

pacman -Syu ; init 6

Last edited by samlt (2007-06-04 18:36:17)

Offline

#7 2007-06-02 16:24:49

KomodoDave
Member
From: Oxford, UK
Registered: 2007-04-22
Posts: 162
Website

Re: Convenience question

Ramses de Norre wrote:

Does ctrl-Z pause the application? If that's so you don't want to use my code, I thought ctrl-Z just backgrounded the previous command...

It suspends the job. That's why you get '[jobID] Stopped: ...' or whatever stdout says.

- Dave

Last edited by KomodoDave (2007-06-02 16:25:39)

Offline

#8 2007-06-04 17:39:35

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: Convenience question

raeven wrote:

this should work; sorry can't shutdown now , pc is busy .. but a simple echo worked, so init shoudl work as well ( it failed in the pass, but i know why)

pacman -Syu && init 6 || init 6

you might wanna add the --noconfirm option/ tells pacman to just choose the default option if a question is asked;
and f (as-in Syuf) to force overwrite files if conflicts arise, it might be dangerous but in my experience, it's never caused a problem ..
&& - and
|| - or

use both so it reboots irrespectively of the result. ( reboot even if it fails)

He's problem is that he wants to add the second command if the first is already running...

Offline

Board footer

Powered by FluxBB