diff options
author | Martin Schwenke <martin@meltin.net> | 2009-12-01 17:43:47 +1100 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2009-12-01 17:43:47 +1100 |
commit | db25ca69e56ea7d8808e1ace9d9cc28a611aab0c (patch) | |
tree | fdff0d00aa1d438d0b1dce8c1025884e71f7294c /ctdb/config/events.d/11.routing | |
parent | ad431c352004c0fdf4714919872cac043e1618dc (diff) | |
download | samba-db25ca69e56ea7d8808e1ace9d9cc28a611aab0c.tar.gz samba-db25ca69e56ea7d8808e1ace9d9cc28a611aab0c.tar.xz samba-db25ca69e56ea7d8808e1ace9d9cc28a611aab0c.zip |
Eventscript argument cleanups and introduction of ctdb_standard_event_handler.
The functions file no longer causes a side-effect by doing a shift.
It also doesn't set a convenience variable for $1.
All eventscripts now explicitly use "$1" in their case statement, as
does the initscript. The absence of a shift means that the
takeip/releaseip events now explicitly reference $2-$4 rather than
$1-$3.
New function ctdb_standard_event_handler handles the status and
setstatus events, and exits for either of those events. It is called
via a default case in each eventscript, replacing an explicit status
case where applicable.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 3d55408cbbb3bb71670b80f3dad5639ea0be5b5b)
Diffstat (limited to 'ctdb/config/events.d/11.routing')
-rwxr-xr-x | ctdb/config/events.d/11.routing | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ctdb/config/events.d/11.routing b/ctdb/config/events.d/11.routing index cb34e417a8..c265c382d0 100755 --- a/ctdb/config/events.d/11.routing +++ b/ctdb/config/events.d/11.routing @@ -19,15 +19,17 @@ loadconfig exit 0 } -case $cmd in - takeip|releaseip) - iface=$1 +case "$1" in + takeip|releaseip) + iface=$2 cat $CTDB_BASE/static-routes | egrep "^$iface " | while read IFACE DEST GW; do ip route add $DEST via $GW dev $IFACE >/dev/null 2>/dev/null done - ;; + *) + ctdb_standard_event_handler "$@" + ;; esac exit 0 |