diff options
author | Martin Schwenke <martin@meltin.net> | 2011-08-23 16:36:19 +1000 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2011-08-30 09:33:47 +1000 |
commit | bc4e62be851aadc4ade9f14f16b396089032a83b (patch) | |
tree | 5b1f78106134c220f82f04d0b66537b1a5defa1f | |
parent | 7980a4cb44dce3bb69893f5ea366c45462123a43 (diff) | |
download | samba-bc4e62be851aadc4ade9f14f16b396089032a83b.tar.gz samba-bc4e62be851aadc4ade9f14f16b396089032a83b.tar.xz samba-bc4e62be851aadc4ade9f14f16b396089032a83b.zip |
Eventscripts - call ctdb_check_args() instead of doing hand checking
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit cc5bc1948dcbe8b8b25185260927b94a4b529174)
-rwxr-xr-x | ctdb/config/events.d/10.interface | 16 | ||||
-rwxr-xr-x | ctdb/config/events.d/13.per_ip_routing | 15 |
2 files changed, 4 insertions, 27 deletions
diff --git a/ctdb/config/events.d/10.interface b/ctdb/config/events.d/10.interface index f75e6afea4..356ee08245 100755 --- a/ctdb/config/events.d/10.interface +++ b/ctdb/config/events.d/10.interface @@ -129,6 +129,8 @@ monitor_interfaces() return 1 } +ctdb_check_args "$@" + case "$1" in ############################# # called when ctdbd starts up @@ -158,10 +160,6 @@ case "$1" in ################################################ # called when ctdbd wants to claim an IP address takeip) - if [ $# != 4 ]; then - echo "ERROR: must supply interface, IP and maskbits" - exit 1 - fi iface=$2 ip=$3 maskbits=$4 @@ -181,11 +179,6 @@ case "$1" in ################################################## # called when ctdbd wants to release an IP address releaseip) - if [ $# != 4 ]; then - echo "ERROR: must supply interface, IP and maskbits" - exit 1 - fi - # releasing an IP is a bit more complex than it seems. Once the IP # is released, any open tcp connections to that IP on this host will end # up being stuck. Some of them (such as NFS connections) will be unkillable @@ -220,11 +213,6 @@ case "$1" in ################################################## # called when ctdbd wants to update an IP address updateip) - if [ $# != 5 ]; then - echo "ERROR: must supply old interface, new interface, IP and maskbits" - exit 1 - fi - # moving an IP is a bit more complex than it seems. # First we drop all traffic on the old interface. # Then we try to add the ip to the new interface and before diff --git a/ctdb/config/events.d/13.per_ip_routing b/ctdb/config/events.d/13.per_ip_routing index ff4dbdb8c3..d8a064493e 100755 --- a/ctdb/config/events.d/13.per_ip_routing +++ b/ctdb/config/events.d/13.per_ip_routing @@ -326,6 +326,8 @@ setup_per_ip_routing() return $?; } +ctdb_check_args "$@" + case "$1" in ############################# # called when ctdbd starts up @@ -368,10 +370,6 @@ case "$1" in ################################################ # called when ctdbd wants to claim an IP address takeip) - if [ $# != 4 ]; then - echo "must supply interface, IP and maskbits" - exit 1 - fi iface=$2 ip=$3 maskbits=$4 @@ -410,10 +408,6 @@ case "$1" in ################################################ # called when ctdbd wants to claim an IP address updateip) - if [ $# != 5 ]; then - echo "must supply old interface, new interface, IP and maskbits" - exit 1 - fi oiface=$2 niface=$3 ip=$4 @@ -455,11 +449,6 @@ case "$1" in ################################################## # called when ctdbd wants to release an IP address releaseip) - if [ $# != 4 ]; then - echo "must supply interface, IP and maskbits" - exit 1 - fi - iface=$2 ip=$3 maskbits=$4 |