/usr/share/doc/bacula-common/examples/reports/is_client_alive is in bacula-common 7.0.5+dfsg-4build1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 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 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}
|