1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/ctdb/config/events.d/31.clamd
Martin Schwenke 9255d645f3 ctdb-scripts: Avoid shellcheck warnings SC2046, SC2086 (double-quoting)
SC2046: Quote this to prevent word splitting.
SC2086: Double quote to prevent globbing and word splitting.

Add some quoting where it makes sense.  Use shellcheck directives for
false-positives.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:26 +02:00

53 lines
863 B
Bash
Executable File

#!/bin/sh
# event script to manage clamd in a cluster environment
[ -n "$CTDB_BASE" ] || \
CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
. "${CTDB_BASE}/functions"
detect_init_style
case $CTDB_INIT_STYLE in
redhat)
service_name="clamd"
# service_config is used by loadconfig()
# shellcheck disable=SC2034
service_config="clamd"
;;
*)
service_name="clamav"
# service_config is used by loadconfig()
# shellcheck disable=SC2034
service_config="clamav"
;;
esac
service_start ()
{
service $service_name stop > /dev/null 2>&1
service $service_name start
}
loadconfig
ctdb_start_stop_service
is_ctdb_managed_service || exit 0
case "$1" in
startup)
ctdb_service_start
;;
shutdown)
ctdb_service_stop
;;
monitor)
ctdb_check_unix_socket "$CTDB_CLAMD_SOCKET" || exit $?
;;
esac
exit 0