From: Andrew Tridgell Date: Tue, 29 May 2007 03:01:31 +0000 (+1000) Subject: added an example ctdb event script X-Git-Tag: tevent-0.9.20~348^2~2659 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a39eff68a894ccf71cdff45b02d34a79d9448c74;p=thirdparty%2Fsamba.git added an example ctdb event script (This used to be ctdb commit f97b75497d005306c5f893c3182f1c2a9b4dc6b7) --- diff --git a/ctdb/tools/events b/ctdb/tools/events new file mode 100644 index 00000000000..8baca539e40 --- /dev/null +++ b/ctdb/tools/events @@ -0,0 +1,39 @@ +#!/bin/sh +# sample event script for ctdb + +cmd="$1" +shift + +case $cmd in + takeip) + if [ $# != 3 ]; then + echo "must supply interface, IP and maskbits" + exit 1 + fi + iface=$1 + ip=$2 + maskbits=$3 + exec /sbin/ip add $ip/$maskbits dev $iface + exit 1 + ;; + + releaseip) + if [ $# != 3 ]; then + echo "must supply interface, IP and maskbits" + exit 1 + fi + iface=$1 + ip=$2 + maskbits=$3 + exec /sbin/ip del $ip/$maskbits dev $iface + exit 1 + ;; + + recovered) + # restart any services as necessary, like NFS + exit 0 + ;; +esac + +echo "Invalid command $cmd" +exit 1