Bug#360778: [Pkg-nagios-devel] Bug#360778: nagios2: /etc/init.d/restart does not start nagios

Jim Jensen jensen at computer.org
Tue Apr 4 21:02:21 UTC 2006


I thought if that, but left it as [ -z "$?" -o "$?" == 0 ] just in case $? was 
not defined.  I would guess that is impossible with bash, but I am not sure 
about other shells.  

I am also not sure about "0" vs 0, my understanding is that the quotes are 
removed before the comparison, so it doesn't matter in this case.

I am not sure about the = vs ==.  == appears to work in bash, but I don't know 
which is more portable.

Thanks,
	-Jim

On Tuesday 04 April 2006 14:55, sean finney wrote:
> hi jim,
>
> On Tue, Apr 04, 2006 at 12:50:35PM -0400, Jim Jensen wrote:
> > --- /etc/init.d/nagios2		2006-04-04 10:35:07.783457264 -0400
> > +++ /etc/init.d/nagios2~	2006-02-12 05:22:24.000000000 -0500
> > @@ -181,7 +181,7 @@
> >    restart)
> >      log_daemon_msg "Restarting $DESC" "$NAME"
> >      stop
> > -    if [ -z "$?" -o "$?" == 0 ]; then
> > +    if [ -z "$?" ]; then
>
> hrm... shouldn't that be
>
> if [ "$?" = "0" ];
>
> ?
>
> 	sean




More information about the Pkg-nagios-devel mailing list