启动脚本
#!/bin/bash
cd /redis/src
pid = ps -ef | grep ‘redis-server’ | grep -v grep | awk '{print $2}’
if [ -z $pid ]; then
./redis-server ../redis.conf &
else
echo “already $pid”
fi
结束脚本
#!/bin/bash
cd /redis/src
pid = ps -ef | grep ‘redis-server’ | grep -v grep | awk '{print $2}’
if [ -z $pid ]; then
echo ‘null'
else
kill $pid
fi