1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
samba-mirror/ctdb/config/notify.sh
Martin Schwenke 9ec9e6f77b ctdb-scripts: Quote some variable expansions
This avoids relevant shellcheck warnings.  This is most of the
shellcheck low hanging fruit in the non-test code.  Many of the other
warnings produced by shellcheck are either false positives, are
non-trivial to fix or a fix may result in worse code.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Wed Jul  6 08:15:49 CEST 2016 on sn-devel-144
2016-07-06 08:15:49 +02:00

28 lines
532 B
Bash
Executable File

#!/bin/sh
# This script is activated by setting CTDB_NOTIFY_SCRIPT=/etc/ctdb/notify.sh
# in /etc/sysconfig/ctdb
# This is script is invoked from ctdb when certain events happen. See
# /etc/ctdb/notify.d/README for more details.
d=$(dirname "$0")
nd="${d}/notify.d"
ok=true
for i in "${nd}/"* ; do
# Don't run files matching basename
case "${i##*/}" in
*~|*,|*.rpm*|*.swp|README) continue ;;
esac
# Files must be executable
[ -x "$i" ] || continue
# Flag failures
"$i" "$1" || ok=false
done
$ok