_my_connections="${tickledir}/${_port}.connections.$$"
# Parentheses are needed around the filters for precedence but
# the parentheses can't be empty!
- #
- # Recent versions of ss print square brackets around IPv6
- # addresses. While it is desirable to update CTDB's address
- # parsing and printing code, something needs to be done here
- # for backward compatibility, so just delete the brackets.
ss -tn state established \
"${_ip_filter:+( ${_ip_filter} )}" \
"${_port_filter:+( ${_port_filter} )}" |
awk 'NR > 1 {print $4, $3}' |
- tr -d '][' |
sort >"$_my_connections"
# Record our current tickles in a temporary file