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