Ticket #3639: freepbx_engine.new.diff
| File freepbx_engine.new.diff, 2.3 kB (added by tbyte, 3 years ago) |
|---|
-
freepbx_engine
old new 106 106 107 107 check_asterisk() { 108 108 # 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 pidofwill return non zero. We call this twice to reduce chances of this happening110 pid_length=` pidofasterisk|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 110 pid_length=`$PIDOF asterisk|awk '{print length($0)}'` 111 111 if [ "$pid_length" == "0" -a "$pid_length" != "" ] 112 112 then 113 113 killall -9 safe_asterisk … … 125 125 # check to see if asterisk is running 126 126 echo 127 127 echo "STARTING ASTERISK" 128 pid_length=` pidofasterisk|awk '{print length($0)}'`128 pid_length=`$PIDOF asterisk|awk '{print length($0)}'` 129 129 if [ "$pid_length" != "0" -a "$pid_length" != "" ] 130 130 then 131 131 echo "Asterisk is already running" … … 145 145 stop_asterisk() { 146 146 echo 147 147 echo "STOPPING ASTERISK" 148 pid_length=` pidofasterisk|awk '{print length($0)}'`148 pid_length=`$PIDOF asterisk|awk '{print length($0)}'` 149 149 if [ "$pid_length" != "0" -a "$pid_length" != "" ] 150 150 then 151 151 /usr/sbin/asterisk -rx "core stop gracefully" | grep -v "No such command" … … 156 156 157 157 check_fop() { 158 158 #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)}'` 160 160 if [ "$pid_length" == "0" -a "$pid_length" != "" ] 161 161 then 162 162 ps -ef | grep safe_opserver | grep -v grep | awk '{print $2}' | xargs kill -9 … … 173 173 # check to see if FOP is running 174 174 echo 175 175 echo "STARTING FOP SERVER" 176 pid_length=` pidof-x op_server.pl|awk '{print length($0)}'`176 pid_length=`$PIDOF -x op_server.pl|awk '{print length($0)}'` 177 177 if [ "$pid_length" != "0" -a "$pid_length" != "" ] 178 178 then 179 179 echo "FOP server is already running" … … 190 190 stop_fop() { 191 191 echo 192 192 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)}'` 194 194 if [ "$pid_length" != "0" -a "$pid_length" != "" ] 195 195 then 196 196 ps -ef | grep safe_opserver | grep -v grep | awk '{print $2}' | xargs kill
