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
fi
}
-delete_all() {
+natgw_clear ()
+{
_ip="${CTDB_NATGW_PUBLIC_IP%/*}"
_maskbits="${CTDB_NATGW_PUBLIC_IP#*/}"
smbcontrol winbindd ip-dropped $CTDB_NATGW_PUBLIC_IP >/dev/null 2>&1
}
-ensure_natgwmaster ()
+natgw_ensure_master ()
{
_event="$1"
case "$1" in
setup)
natgw_check_config
- set_natgw_capability
+ natgw_set_capability
;;
startup)
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
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"
;;
*)