Fix memcached flush if -l is in hostname

Awk should now take the line starting with -l for the listen ip,
instead of any line.

Change-Id: Ib9d8d075f4d9785d2dd077e7cebbb8d3394e24e5
Closes-Bug: 1597410
Signed-off-by: Jean-Philippe Evrard <jean-philippe.evrard@rackspace.co.uk>
This commit is contained in:
Jean-Philippe Evrard 2016-06-29 17:05:39 +01:00
parent 2e7c5adac7
commit 523822b53c

View File

@ -20,4 +20,4 @@
tasks:
- name: Flush all of the cache in memcached
shell: |
echo 'flush_all' | nc $(awk '/\-l/ {print $2}' /etc/memcached.conf | awk -F, '{ print $1 }') $(awk '/\-p/ {print $2}' /etc/memcached.conf)
echo 'flush_all' | nc $(awk '/^\-l/ {print $2}' /etc/memcached.conf | awk -F, '{ print $1 }') $(awk '/^\-p/ {print $2}' /etc/memcached.conf)