mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
3bd68261ec
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Fri Sep 6 11:11:02 UTC 2019 on sn-devel-184
35 lines
764 B
Bash
Executable File
35 lines
764 B
Bash
Executable File
#!/bin/sh
|
|
# script to check accessibility to the reclock file on a node
|
|
|
|
[ -n "$CTDB_BASE" ] || \
|
|
CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
|
|
|
|
. "${CTDB_BASE}/functions"
|
|
|
|
case "$1" in
|
|
init)
|
|
recovery_lock=$("${CTDB_HELPER_BINDIR}/ctdb-config" \
|
|
get cluster "recovery lock")
|
|
# xshellcheck disable=SC2181
|
|
# Above is already complicated enough without embedding into "if"
|
|
case $? in
|
|
0) : ;;
|
|
2) exit 0 ;; # ENOENT: not configured
|
|
*) die "Unexpected error getting recovery lock configuration"
|
|
esac
|
|
|
|
if [ -z "$recovery_lock" ] ; then
|
|
exit 0
|
|
fi
|
|
|
|
# If a helper is specified then exit because this script can't
|
|
# do anything useful
|
|
case "$recovery_lock" in
|
|
!*) exit 0 ;;
|
|
esac
|
|
|
|
d=$(dirname "$recovery_lock")
|
|
mkdir -p "$d"
|
|
;;
|
|
esac
|