#!/bin/bash #Bruno Thibodeau #FreePBX 13 #crontab === */15 * * * * root /etc/cron.d/fpbx-trunk-monitor.sh #Sortir les trunk et leur status trunks=($(asterisk -rx "pjsip show registrations" ! grep Registered | awk '{print$3}')) #Compter le nombre de trunk "Registered" trstatus=($(echo ${trunks[*]} | grep -o 'Registered' | wc -l)) #echo $trstatus #Si moins de deux trunks enregistrés, repartir le process if (( $trstatus != 2 )) ; then $(which fwconsole) reload; fi