#!/bin/bash
ss -tnl | grep 6379
if [ $? -eq 0 ];then
ps -ef | grep redis | awk 'NR==1 {print $2}' | xargs kill -9 && nohup /usr/local/redis/redis-server /usr/local/redis/redis.conf > myout.file 2>&1 &
else
nohup /usr/local/redis/redis-server /usr/local/redis/redis.conf > myout.file 2>&1 &
fi