Pages

Your Ad Here

This Blog is not to read or go through

because, I have never been such a mess


Search the blog instead

Wednesday, June 23, 2010

Kannel restart script | Attempting to Kill a process in linux until it gets killed

Restarting kannel wasn't simpler, as the bearerbox was not exiting on single stop command for Kannel. So needed to do some tricks on killing the bearerbox first. See the code

#!/bin/bash
while [ true ]
do
 echo "quering bearerbox"
 sleep 1
 count=$(ps -C "bearerbox" | wc -l)
 echo $count
 if [ $count -eq 2 ]
 then
  echo "attempting to kill bearerbox"
  killall bearerbox
 else
  sleep 1
  echo "======= bearerbox killed ========"
  break
 fi
done
sleep 1
bearerbox /etc/kannel/kannel.conf
smsfox /etc/kannel/kannel.conf

No comments:

Your Ad Here