]> git.sur5r.net Git - bacula/bacula/commitdiff
Doc + is_client_alive script
authorKern Sibbald <kern@sibbald.com>
Fri, 2 May 2003 09:29:49 +0000 (09:29 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 2 May 2003 09:29:49 +0000 (09:29 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@477 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/examples/is_client_alive [new file with mode: 0755]
bacula/src/console/console.c

diff --git a/bacula/examples/is_client_alive b/bacula/examples/is_client_alive
new file mode 100755 (executable)
index 0000000..e2f9315
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+# Test if Bacula Client is alive
+#   exit 0 if specified client (arg1) is alive
+#   exit 1 if specified client (arg1) is NOT alive
+#   exit 2 if console could NOT connect with Director
+#
+OUTF=/tmp/client-${1}-alive
+rm -f ${OUTF}
+./console >/dev/null <<__EOD
+@output /dev/null
+messages
+@output ${OUTF}
+status client=${1}
+messages
+quit
+__EOD
+grep -s "Daemon started" ${OUTF} 2>&1 >/dev/null
+rtn=$?
+rm -f ${OUTF}
+exit ${rtn}
index 8b00944f951814582395e8c061867e60317546a4..12dbcbb4a98b0e106874d653152028cc3318d86b 100644 (file)
@@ -391,7 +391,10 @@ static void terminate_console(int sig)
    }
    already_here = TRUE;
    free_pool_memory(args);
-   exit(0);
+   if (sig != 0) {
+      exit(1);
+   }
+   return;
 }
 
 #ifdef HAVE_READLINE