Ticket #3639: freepbx_engine.new.diff

File freepbx_engine.new.diff, 2.3 kB (added by tbyte, 3 years ago)
  • freepbx_engine

    old new  
    106106 
    107107check_asterisk() { 
    108108# check to see if asterisk is running 
    109 # Note, this isn't fool-proof.  If safe_asterisk is constantly restarting a dying asterisk, then there is a chance pidof will return non zero.  We call this twice to reduce chances of this happening 
    110 pid_length=`pidof asterisk|awk '{print length($0)}'` 
     109# Note, this isn't fool-proof.  If safe_asterisk is constantly restarting a dying asterisk, then there is a chance $PIDOF will return non zero.  We call this twice to reduce chances of this happening 
     110pid_length=`$PIDOF asterisk|awk '{print length($0)}'` 
    111111  if [ "$pid_length" == "0" -a "$pid_length" != "" ] 
    112112    then 
    113113        killall -9 safe_asterisk 
     
    125125# check to see if asterisk is running 
    126126echo 
    127127echo "STARTING ASTERISK" 
    128 pid_length=`pidof asterisk|awk '{print length($0)}'` 
     128pid_length=`$PIDOF asterisk|awk '{print length($0)}'` 
    129129  if [ "$pid_length" != "0" -a "$pid_length" != "" ] 
    130130    then 
    131131      echo "Asterisk is already running" 
     
    145145stop_asterisk() { 
    146146echo 
    147147echo "STOPPING ASTERISK" 
    148 pid_length=`pidof asterisk|awk '{print length($0)}'` 
     148pid_length=`$PIDOF asterisk|awk '{print length($0)}'` 
    149149  if [ "$pid_length" != "0" -a "$pid_length" != "" ] 
    150150    then 
    151151      /usr/sbin/asterisk -rx "core stop gracefully" | grep -v "No such command" 
     
    156156 
    157157check_fop() { 
    158158#check to see if FOP is running 
    159   pid_length=`pidof -x op_server.pl|awk '{print length($0)}'` 
     159  pid_length=`$PIDOF -x op_server.pl|awk '{print length($0)}'` 
    160160  if [ "$pid_length" == "0" -a "$pid_length" != "" ] 
    161161    then 
    162162        ps -ef | grep safe_opserver | grep -v grep | awk '{print $2}' | xargs kill -9 
     
    173173# check to see if FOP is running 
    174174echo 
    175175echo "STARTING FOP SERVER" 
    176 pid_length=`pidof -x op_server.pl|awk '{print length($0)}'` 
     176pid_length=`$PIDOF -x op_server.pl|awk '{print length($0)}'` 
    177177  if [ "$pid_length" != "0" -a "$pid_length" != "" ] 
    178178    then 
    179179      echo "FOP server is already running" 
     
    190190stop_fop() { 
    191191  echo 
    192192  echo "STOPPING FOP SERVER" 
    193   pid_length=`pidof -x op_server.pl|awk '{print length($0)}'` 
     193  pid_length=`$PIDOF -x op_server.pl|awk '{print length($0)}'` 
    194194    if [ "$pid_length" != "0" -a "$pid_length" != "" ] 
    195195      then 
    196196        ps -ef | grep safe_opserver | grep -v grep | awk '{print $2}' | xargs kill