ctdb-scripts: Event scripts must end with ".script" suffix
[samba.git] / ctdb / config / events / legacy / 99.timeout.script
1 #!/bin/sh
2 #
3 # Event script to just sleep longer than the timeout
4 # in the monitor action. The purpose is to trigger
5 # the event timeout mechanism.
6
7 [ -n "$CTDB_BASE" ] || \
8     CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
9
10 . "${CTDB_BASE}/functions"
11
12 load_script_options
13
14 [ "$CTDB_RUN_TIMEOUT_MONITOR" = "yes" ] || exit 0
15
16 case "$1" in
17 monitor)
18         TIMEOUT=$($CTDB getvar EventScriptTimeout | awk '{print $3}')
19         echo "sleeping for $((TIMEOUT * 2)) seconds..."
20         sleep $((TIMEOUT * 2))
21         ;;
22 esac
23
24 exit 0
25