Added more exit codes

This commit is contained in:
deajan 2014-05-23 23:47:34 +02:00
parent c3f5534c64
commit c40462d4c6
1 changed files with 6 additions and 1 deletions

View File

@ -92,9 +92,11 @@ status() {
if [ ! -f $pidfile-* ] if [ ! -f $pidfile-* ]
then then
echo "Cannot find any running osync instance." echo "Cannot find any running osync instance."
exit exit 1
fi fi
errno=0
for pfile in $pidfile-* for pfile in $pidfile-*
do do
if ps -p$(cat $pfile) > /dev/null 2>&1 if ps -p$(cat $pfile) > /dev/null 2>&1
@ -102,8 +104,11 @@ status() {
echo "$prog instance $(basename $pfile) is running (pid $(cat $pfile))" echo "$prog instance $(basename $pfile) is running (pid $(cat $pfile))"
else else
echo "$pfile is dead but lockfile exists." echo "$pfile is dead but lockfile exists."
$errno=1
fi fi
done done
exit $errno
} }
case "$1" in case "$1" in