only run cronjob when asteriks voip gives 0 on channels
i have set up a asteriks voip and add a cronjob to send the output of a specific command to my email after the cronjob shutdown -r now.
now i need a script that prevents the cronjob (reboot and email) from being executed if this command: asteriks -rx "show channels" states active connections(to prevent active calls being terminated)
the output of the command above(asteriks -rx "show channels") is as follows(if there are no calls)
hope some 1 can help me with this
The easy way is to write a script. Something like this.
Then run this script from the cronjob. When the script is
run, it waits until after both channels are clear before
# @(#) reboot-voip reboot voip server after calls clear
until [ `asterisk -rx "show channels" | grep "^0 act" | wc -l` -eq 2 ]
shutdown -r now
|All times are GMT -5. The time now is 01:07 AM.|