source: vendor/current/ctdb/config/ctdb-crash-cleanup.sh

Last change on this file was 988, checked in by Silvan Scherrer, 9 years ago

Samba Server: update vendor to version 4.4.3

File size: 731 bytes
Line 
1#!/bin/sh
2#
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.
5#
6
7[ -n "$CTDB_BASE" ] || \
8 export CTDB_BASE=$(cd -P $(dirname "$0") ; echo "$PWD")
9
10. "$CTDB_BASE/functions"
11
12# If ctdb is running, just exit
13if service ctdb status >/dev/null 2>&1 ; then
14 exit 0
15fi
16
17loadconfig ctdb
18
19[ -n "$CTDB_PUBLIC_ADDRESSES" ] || \
20 CTDB_PUBLIC_ADDRESSES="$CTDB_BASE/public_addresses"
21
22[ -f "$CTDB_PUBLIC_ADDRESSES" ] || \
23 die "No public addresses file found. Can't clean up."
24
25drop_all_public_ips 2>&1 | script_log "ctdb-crash-cleanup.sh"
26
27if [ -n "$CTDB_NATGW_PUBLIC_IP" ] ; then
28 drop_ip "$CTDB_NATGW_PUBLIC_IP" "ctdb-crash-cleanup.sh"
29fi
Note: See TracBrowser for help on using the repository browser.