linux user group brescia

immagine del castello

Archivio della mailing list

up2date in automatico all'avvio

Giuseppe Corbelli cowo a lugbs.linux.it
Dom 22 Feb 2004 15:54:51 UTC
On Sun, Feb 22, 2004 at 12:12:57PM +0100, Giorgio PasiniRuffoni wrote:
> 
> Ciao a tutti vorrei fare un
> piccol script della bash, che riavvia un programma ogni volta che esce con 
> error code 1 invece che 0.
> 
> non esiste una sorta di 
> /bin/sh
> repeat
> up2date --nox -i -u 
> until errorcode = 0
L'error code e' la variabile $?
A spanne potresti:

$?=1
while [ $? -ne "0" ]
do
	roba varia
done
 
> e soprattutto, dove faccio richiamare questo script in fase di avvio?
> inittab non รจ il file giusto!
Dipende un poco anche dalla distribuzione, ma in generale serve fare uno
script di avvio in /etc/rcX.d con X il runlevel di default.
 
-- 
	Giuseppe "Cowo" Corbelli ~\/~ My software: http://cowo.yoda2000.net
The primary purpose of the DATA statement is to give names to constants;
instead of referring to pi as 3.141592653589793 at every appearance,
the variable PI can be given that value with a DATA statement and
used instead of the longer form of the constant.  This also
simplifies modifying the program, should the value of pi change.
                        --  FORTRAN manual for Xerox computers



Maggiori informazioni sulla lista Lug