Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > fbe3cb3c4df145e372a48e3c80b63097 > files > 77

bacula2-common-2.4.4-7.fc15.i686.rpm

#!/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 to 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}