]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
added an example ctdb event script
authorAndrew Tridgell <tridge@samba.org>
Tue, 29 May 2007 03:01:31 +0000 (13:01 +1000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 29 May 2007 03:01:31 +0000 (13:01 +1000)
(This used to be ctdb commit f97b75497d005306c5f893c3182f1c2a9b4dc6b7)

ctdb/tools/events [new file with mode: 0644]

diff --git a/ctdb/tools/events b/ctdb/tools/events
new file mode 100644 (file)
index 0000000..8baca53
--- /dev/null
@@ -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