On Sun, Aug 21, 2005 at 12:32:06AM +1000, Mark Edwards wrote: > concur that the best way around this is to perioically restart.
This is ignoring the problem rather than solving it. If you both rmmod zaptel and restart asterisk, why not simply reboot? All of those sleeps there produce a nice downtime. See remarks below. > > FWIW this is my restart script which I invoke from cron in the middle > of the night... > > #!/bin/bash > ASTERISK=/usr/sbin/asterisk > RMMOD=/sbin/rmmod > MODPROBE=/sbin/modprobe > ZTCFG=/sbin/ztcfg > > echo "Stopping" > $ASTERISK -rx "stop when convenient" > if [ $? == 0 ]; then > > #let COUNT=0 why do math in shell scripts? for i in `seq 40` > while true; do > echo "waiting for asterisk to stop" > if [ ! -e /var/run/asterisk.pid ]; then > break; > fi A sudden 'killall -9 asterisk' by someone and that cron job will be in an endless loop. > sleep 5; > echo "." > # let COUNT=COUNT+1 > # if [ $COUNT == 40 ]; then > # break; > # fi > done > > fi > > echo unloading modules.... > $RMMOD wctdm > sleep 5 > $RMMOD zaptel > sleep 15 > killall -9 mpg123 > echo loading modules > $MODPROBE zaptel > sleep 15 > $MODPROBE wctdm > sleep 15 > $ZTCFG -v > sleep 5 > echo "Starting...." > $ASTERISK -- Tzafrir Cohen | [EMAIL PROTECTED] | VIM is http://tzafrir.org.il | | a Mutt's [EMAIL PROTECTED] | | best ICQ# 16849755 | | friend _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users