#!/bin/bash

str1=`ps -C freeswitch --no-header | wc -l`
if [ $str1 -ne 0 ];
then
    echo 1
elif [ $str1  -eq 0 ];
then
    echo 0
    sleep 1
    /home/server/switch/freeswitch/bin/freeswitch -ncwait -nonat -nosql ||exit
    #freeswitch -ncwait -nonat -nosql ||exit
    echo "$(date)_FS进程重启" >> /home/shellJob/fsProcess_check.log
else
    echo $str1
fi
