From c40462d4c6a2702cb056ed28dd7dc962dd4c08e5 Mon Sep 17 00:00:00 2001 From: deajan Date: Fri, 23 May 2014 23:47:34 +0200 Subject: [PATCH] Added more exit codes --- osync-srv | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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