ctdb-scripts: Move event scripts to events/legacy/ directory
[samba.git] / ctdb / config / events / legacy / 06.nfs.script
1 #!/bin/sh
2 # script to manage nfs in a clustered environment
3
4 [ -n "$CTDB_BASE" ] || \
5     CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
6
7 . "${CTDB_BASE}/functions"
8
9 service_name="nfs"
10
11 load_script_options "service" "60.nfs"
12
13 ctdb_setup_state_dir "service" "$service_name"
14
15 ######################################################################
16
17 nfs_callout_pre ()
18 {
19         _event="$1"
20         shift
21
22         nfs_callout "${_event}-pre" "$@"
23 }
24
25 ######################################################################
26
27 # script_state_dir set by ctdb_setup_state_dir()
28 # shellcheck disable=SC2154
29 nfs_callout_init "$script_state_dir"
30
31 [ "$CTDB_MANAGES_NFS" = "yes" ] || exit 0
32
33 case "$1" in
34 takeip)
35         nfs_callout_pre "$@"
36         ;;
37
38 releaseip)
39         nfs_callout_pre "$@"
40         ;;
41 esac