s3-libsmb: fail rename and replace inside cifs variant
[Samba.git] / ctdb / config / ctdb-crash-cleanup.sh
blob22b0ce86f5f2bb075a76d6d5e2d23f2a2456750e
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 loadconfig ctdb
19 [ -n "$CTDB_PUBLIC_ADDRESSES" ] || \
20 CTDB_PUBLIC_ADDRESSES="$CTDB_BASE/public_addresses"
22 [ -f "$CTDB_PUBLIC_ADDRESSES" ] || \
23 die "No public addresses file found. Can't clean up."
25 drop_all_public_ips 2>&1 | script_log "ctdb-crash-cleanup.sh"
27 if [ -n "$CTDB_NATGW_PUBLIC_IP" ] ; then
28 drop_ip "$CTDB_NATGW_PUBLIC_IP" "ctdb-crash-cleanup.sh"