标签:memcache val gre get 脚本 echo color false value
#!/bin/bash . /etc/init.d/functions if [ `netstat -lntup| grep 11211|wc -l` -lt 1 ];then action "Memcached Serivce is error." /bin/false exit 1 fi echo -e "del key\r\n"| nc 127.0.0.1 11211 &>/dev/null echo -e "set key 0 0 10 \r\noldboy1234\r\n" |nc 127.0.0.1 11211 &>/dev/null MCValues=`echo -e "get key\r\n"|nc 127.0.0.1 11211| grep oldboy1234|wc -l` if [ $MCValues -eq 1 ];then action "Memcached Service Status is OK." /bin/true else action "Memcached Service Status is Error." /bin/false fi
echo -e 可以替换为 printf
标签:memcache val gre get 脚本 echo color false value
原文地址:http://www.cnblogs.com/vincenshen/p/6612782.html