events/50.samba: fix ports check to cope with Samba 4 formatting.
authorMichael Adam <obnox@samba.org>
Thu, 31 Jul 2014 14:25:08 +0000 (16:25 +0200)
committerMichael Adam <obnox@samba.org>
Thu, 31 Jul 2014 14:32:28 +0000 (16:32 +0200)
The default output formatting of lists in testparm has changed
from " " separator to ", " separator. Our original eventscript
code stumbles across port "445,". Map away that comma... :-)

This has been fixed in master and 2.5 silently as part of
a bigger rewrite.

Signed-off-by: Michael Adam <obnox@samba.org>
config/events.d/50.samba

index 5c10b19ef08b55adb8ed9d40f1daecc8241b1832..707b7b74f149995d7c34e73c574d5562bde168ab 100755 (executable)
@@ -239,7 +239,8 @@ case "$1" in
 
                smb_ports="$CTDB_SAMBA_CHECK_PORTS"
                [ -z "$smb_ports" ] && {
-                       smb_ports=`testparm_cat --parameter-name="smb ports"`
+                       smb_ports=`testparm_cat --parameter-name="smb ports" |
+                                       sed -e 's/,/ /g'`
                }
                ctdb_check_tcp_ports $smb_ports || exit $?
        }