Problem with init script.. :-[
Since I'm not that great in bash, I would like to ask for some help.
I wrote a script that will kill all instances of yiff-server (new one,
not yet in unstable as I have this problem).
Each yiff instance makes a pid file as follows:
with PID in the file.
Here's my stop) part of yiff-server:
echo -n "Stopping $DESC":
k=`ls /var/run/$NAME*.pid 2>/dev/null`
for i in non $k; do
if [ "$i" != non ]; then
kill `cat $i` 2> /dev/null;
rm -f $i;
It works, _BUT_ if no server is running, it bails out on me
so people can't upgrade if they have yiff-server installed
but not running.
If I try to check if pid file exists in first place by,
if [ -e /var/run/$NAME*.pid ]; then blah blah
I get error if more than one pid file is there.
How can I detect if the file(s) exist without causing
the init script to bail out??
Thanks in advance,