Hi all, I have been here before for a script that I can use for an alert to when the TRUNK or REGISTRY fail, this works 100%, Now I have another question, How can I add the “core restart now” to my script as to when it finds that the TRUNK or REGISTRY failed that it can automatically do a core restart now.
I have found that when this happens I need to log in to my FPBX server and do the CLI “core restart now” for all to register again.
Look at my script I’m running at this moment for the alert.
$asteriskbin -rx "sip show peer $thistrunk" | grep Status | grep -wc OK
if [[ $checkifok == 0 ]]; then
echo “Trunk is DOWN” | mail -s " - Trunk is Down [$HOST] -" "$EMAIL"
echo "Trunk OK"
I would like to add this to the "echo “Trunk is DOWN” line as to sent me an e-mail as it does and then do the core restart now command.
Would that be possible and are there someone out there that might be able to help me.