Skip to content

Instantly share code, notes, and snippets.

@seqizz
Created July 9, 2014 14:57
Show Gist options
  • Save seqizz/e58e13ba906568d199a2 to your computer and use it in GitHub Desktop.
Save seqizz/e58e13ba906568d199a2 to your computer and use it in GitHub Desktop.
Check memcached
#!/bin/bash
PORT=$1
if [[ `echo stats | nc -w 1 127.0.0.1 $PORT | grep STAT | head -1 | awk {'print $1'}` == "STAT" ]]; then
#Response OK
exit 0
else
#No response - FAIL
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment