s3/rpc_client: Fix array offset check
[Samba.git] / ctdb / config / ctdb-crash-cleanup.sh
blob95cfd75981fd48caf8faea747baa7cf306be18ae
1 #!/bin/sh
3 # This script can be called from a cronjob to automatically drop/release
4 # all public ip addresses if CTDBD has crashed or stopped running.
7 [ -n "$CTDB_BASE" ] || \
8 CTDB_BASE=$(d=$(dirname "$0") && cd -P "$d" && echo "$PWD")
10 . "${CTDB_BASE}/functions"
12 # If ctdb is running, just exit
13 if service ctdb status >/dev/null 2>&1 ; then
14 exit 0
17 load_script_options "failover" "11.natgw"
19 if [ ! -f "$CTDB_BASE/public_addresses" ] ; then
20 die "No public addresses file found. Can't clean up."
23 drop_all_public_ips 2>&1 | script_log "ctdb-crash-cleanup.sh"
25 if [ -n "$CTDB_NATGW_PUBLIC_IP" ] ; then
26 drop_ip "$CTDB_NATGW_PUBLIC_IP" "ctdb-crash-cleanup.sh"