You are not logged in.
Pages: 1
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
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
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
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
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
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
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
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
|| - oruse 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
Pages: 1