On Thu, 01 Jul 2010 21:05:14 +0100, Julien Cristau wrote: > > + if $(/etc/init.d/mysql status >/dev/null 2>&1); then > What is this trying to test? Redirecting the command's stdout and > stderr to /dev/null and testing if the output is empty doesn't seem very > useful...
Seems to work fine: r...@guinan:~# /etc/init.d/mysql start Starting MySQL database server: mysqld .. Checking for corrupt, not cleanly closed and upgrade needing tables.. r...@guinan:~# if $(/etc/init.d/mysql status >/dev/null 2>&1); then echo $? "MySQL up"; else echo $? "No MySQL"; fi 0 MySQL up r...@guinan:~# /etc/init.d/mysql stop Stopping MySQL database server: mysqld. r...@guinan:~# if $(/etc/init.d/mysql status >/dev/null 2>&1); then echo $? "MySQL up"; else echo $? "No MySQL"; fi 3 No MySQL r...@guinan:~# Cheers, gregor -- .''`. http://info.comodo.priv.at/ -- GPG key IDs: 0x8649AA06, 0x00F3CFE4 : :' : Debian GNU/Linux user, admin, & developer - http://www.debian.org/ `. `' Member of VIBE!AT & SPI, fellow of Free Software Foundation Europe `- NP: Peter Ratzenbeck: Der Ohrwurm
signature.asc
Description: Digital signature