11 lines
320 B
Bash
11 lines
320 B
Bash
#!/bin/bash
|
|
notok=`/usr/bin/sudo /usr/sbin/asterisk -rx 'sip show peers' | grep -E "^\<[0-9]{3}\>" | grep -vc OK`
|
|
if [ $notok == "0" ]
|
|
then
|
|
echo 0
|
|
else
|
|
peer_down=`/usr/bin/sudo /usr/sbin/asterisk -rx 'sip show peers' | grep UN | grep -oE "^\<[0-9]{3}\>"`
|
|
echo -e "\n$peer_down" | sed 's/$/::/g' #| head -c 3
|
|
#echo ""
|
|
fi
|