📜  自动重启 redis 服务的脚本 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:50.788000             🧑  作者: Mango

代码示例1
#!/bin/bash
a=$(redis-cli -p 6379 PING)
if [ "$a" = "PONG" ]
then
    echo 'Already running'
else
    b=$(/etc/init.d/redis_6379 start)   
    echo $b
fi