centos7-shell脚本判断fdfs掉线重启


#!/bin/bash
a=`netstat -unltp|grep fdfs_trackerd|wc -l`
b=`netstat -unltp|grep fdfs_stroraged|wc -l`

echo "$a"
if [ "$a" -ne "1" ];then
    `fdfs_trackerd /etc/fdfs/tracker.conf start`
fi
echo "$b"
if [ "$b" -ne "1" ];then
    `fdfs_storaged /etc/fdfs/storage.conf start`
fi