Initscript: clean up drop_all_public_ips()
authorMartin Schwenke <martin@meltin.net>
Tue, 17 Jul 2012 05:45:45 +0000 (15:45 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Thu, 26 Jul 2012 12:05:43 +0000 (22:05 +1000)
This makes the case implicit where $CTDB_PUBLIC_ADDRESSES is unset.
This is OK because that's not an interesting code path.

Signed-off-by: Martin Schwenke <martin@meltin.net>
config/ctdb.init

index 5d01a9c58faec2ae890bd4b99549c0ec9641ded3..71b187a1042083055c67ec99b807bb230c9607b5 100755 (executable)
@@ -244,13 +244,9 @@ wait_until_ready () {
 ctdbd=${CTDBD:-/usr/sbin/ctdbd}
 
 drop_all_public_ips() {
-    [ -z "$CTDB_PUBLIC_ADDRESSES" ] && {
-       return
-    }
-
-    cat $CTDB_PUBLIC_ADDRESSES | while read IP IFACE REST; do
-       ip addr del $IP dev $IFACE >/dev/null 2>/dev/null
-    done
+    while read _ip _iface _rest; do
+       ip addr del $_ip dev $_iface >/dev/null 2>&1
+    done <"${CTDB_PUBLIC_ADDRESSES:-/dev/null}"
 }
 
 start() {