From c0b7fbf2a42cc601923349baf8904fc9ca2deb10 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Tue, 17 Jul 2012 15:21:10 +1000 Subject: [PATCH] Eventscripts: 11.natgw $CTDB_NATGW_PUBLIC_IP splitting optimisation $CTDB_NATGW_PUBLIC_IP can be split into $_ip and $_maskbits without forking lots of processes. Also "local" isn't supported by POSIX. Signed-off-by: Martin Schwenke (This used to be ctdb commit e20fdb974158061f4627d6f360c168d764690e6f) --- ctdb/config/events.d/11.natgw | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ctdb/config/events.d/11.natgw b/ctdb/config/events.d/11.natgw index 509375231a2..f6164cf88bd 100755 --- a/ctdb/config/events.d/11.natgw +++ b/ctdb/config/events.d/11.natgw @@ -18,8 +18,8 @@ else fi delete_all() { - local _ip=`echo $CTDB_NATGW_PUBLIC_IP | cut -d '/' -f1` - local _maskbits=`echo $CTDB_NATGW_PUBLIC_IP | cut -d '/' -f2` + _ip="${CTDB_NATGW_PUBLIC_IP%/*}" + _maskbits="${CTDB_NATGW_PUBLIC_IP#*/}" [ -z "$CTDB_NATGW_PUBLIC_IFACE" ] || { delete_ip_from_iface $CTDB_NATGW_PUBLIC_IFACE $_ip $_maskbits 2>/dev/null