[Asterisk-Users] Check and restart script..

Andrew Kohlsmith akohlsmith-asterisk at benshaw.com
Thu Sep 25 05:35:59 MST 2003


> I was thinking of a simple bash script something like running "ps -aux
> |grep asterisk" and then some kind of "if" to say that if the result is
> nothing then execute asterisk.. Problem with that theory is that the "ps"
> command will show up as well so i will have to work out a way to drop
> that..

Anything particularly wrong with 

while [ 1 ] ; do /path/to/asterisk -vvvgcf ; sleep 1 ; done

?  Stopping it might be a pain but that's easy to add in.

I have just this morning run into an asterisk box (phonejack PCI and X100P 
fxo) which seemed to forget about the FXS port entirely.  It was otherwise 
up and running fine, but had to be restarted.

I bypassed the asterisk box for the day so my wife wouldn't have to put up 
with spotty phone service.  :-)

Regards,
Andrew



More information about the asterisk-users mailing list