Merge "healthcheck/memcached: add brackets if ipv6" into stable/queens

This commit is contained in:
Zuul 2018-07-16 05:20:26 +00:00 committed by Gerrit Code Review
commit 0c86c23350
1 changed files with 6 additions and 0 deletions

View File

@ -1,5 +1,11 @@
#!/bin/bash
listen_addr=$(awk 'match($0, /-l +([0-9a-fA-F\.\:]+) /, a) {print a[1]}' /etc/sysconfig/memcached)
# Add brackets if IPv6
if [[ $listen_addr =~ ":" ]]; then
listen_addr="[${listen_addr}]"
fi
echo "stats" | socat - TCP:$listen_addr:11211
exit