summaryrefslogtreecommitdiffstats
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2014-03-07 13:47:43 +1100
committerAmitay Isaacs <amitay@samba.org>2014-03-26 04:21:42 +0100
commit3c839c60d15f11c538709c3e6b85d888131d6e30 (patch)
tree25762b5a676538e9462c44c4734772b3215f34a0 /ctdb
parentc0e239473b532cebd31ef5e53d8cbf23c262c18d (diff)
downloadsamba-3c839c60d15f11c538709c3e6b85d888131d6e30.tar.gz
samba-3c839c60d15f11c538709c3e6b85d888131d6e30.tar.xz
samba-3c839c60d15f11c538709c3e6b85d888131d6e30.zip
ctdb-eventscripts: Rename some NAT gateway functions
delete_all() really needed renaming for clarity. While doing this, might as well rename some of the others that don't start with "natgw_". Signed-off-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb')
-rwxr-xr-xctdb/config/events.d/11.natgw21
1 files changed, 11 insertions, 10 deletions
diff --git a/ctdb/config/events.d/11.natgw b/ctdb/config/events.d/11.natgw
index e5520361b49..852f8f2e29c 100755
--- a/ctdb/config/events.d/11.natgw
+++ b/ctdb/config/events.d/11.natgw
@@ -26,7 +26,7 @@ natgw_check_config ()
die "Invalid configuration: CTDB_NATGW_PRIVATE_NETWORK not set"
}
-set_natgw_capability ()
+natgw_set_capability ()
{
# Set NATGW capability depending on configuration
if [ "$CTDB_NATGW_SLAVE_ONLY" = "yes" ] ; then
@@ -36,7 +36,8 @@ set_natgw_capability ()
fi
}
-delete_all() {
+natgw_clear ()
+{
_ip="${CTDB_NATGW_PUBLIC_IP%/*}"
_maskbits="${CTDB_NATGW_PUBLIC_IP#*/}"
@@ -80,7 +81,7 @@ natgw_set_slave ()
smbcontrol winbindd ip-dropped $CTDB_NATGW_PUBLIC_IP >/dev/null 2>&1
}
-ensure_natgwmaster ()
+natgw_ensure_master ()
{
_event="$1"
@@ -97,7 +98,7 @@ ensure_natgwmaster ()
case "$1" in
setup)
natgw_check_config
- set_natgw_capability
+ natgw_set_capability
;;
startup)
@@ -116,10 +117,10 @@ case "$1" in
mypnn=$(ctdb pnn | cut -d: -f2)
- set_natgw_capability
- ensure_natgwmaster "$1"
+ natgw_set_capability
+ natgw_ensure_master "$1"
- delete_all
+ natgw_clear
if [ "$mypnn" = "$natgwmaster" ]; then
natgw_set_master
@@ -133,13 +134,13 @@ case "$1" in
shutdown|removenatgw)
natgw_check_config
- delete_all
+ natgw_clear
;;
monitor)
natgw_check_config
- set_natgw_capability
- ensure_natgwmaster "$1"
+ natgw_set_capability
+ natgw_ensure_master "$1"
;;
*)