diff options
author | Martin Schwenke <martin@meltin.net> | 2012-07-17 15:21:10 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@gmail.com> | 2012-07-26 21:14:57 +1000 |
commit | c0b7fbf2a42cc601923349baf8904fc9ca2deb10 (patch) | |
tree | 2569754eb9b02c58d571703f46127809044d08b7 | |
parent | f2339da878a48c3b1b14fd6cff39ea24d2f5cfcb (diff) | |
download | samba-c0b7fbf2a42cc601923349baf8904fc9ca2deb10.tar.gz samba-c0b7fbf2a42cc601923349baf8904fc9ca2deb10.tar.xz samba-c0b7fbf2a42cc601923349baf8904fc9ca2deb10.zip |
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 <martin@meltin.net>
(This used to be ctdb commit e20fdb974158061f4627d6f360c168d764690e6f)
-rwxr-xr-x | ctdb/config/events.d/11.natgw | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ctdb/config/events.d/11.natgw b/ctdb/config/events.d/11.natgw index 509375231a..f6164cf88b 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 |