Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- #Script to logout dynamic agents from Queue for CUC
- MEMID=`/usr/sbin/asterisk -rx "queue show 2017" | grep "from-queue" | cut -d "(" -f2 | cut -d " " -f1`
- echo $MEMID
- if [ -z "$MEMID" ]
- then
- echo "No agents in the Queue 2017, quitting"
- #logger "No agents in the Queue 2017, quitting"
- exit
- else
- for i in $MEMID
- do
- echo "Removing $i from Queue 2017"
- #logger "Removing $i from Queue 2017"
- VAR=`/usr/sbin/asterisk -rx "queue remove member $i from 2017"`
- echo $VAR
- if [ "$VAR" = "Removed interface $i from queue '2017'" ]
- then
- echo "$i successfully removed from Queue 2017"
- #logger "$i successfully removed from Queue 2017"
- else
- SUB="Queue remove member unsuccessful for CUC"
- BODY="There was an error while logging out dynamic agents from Queue 2017 for CUC"
- echo "$BODY" | /bin/mail -s "$SUB" -r pbx.cucompanies.com deepa@openipsolutions.com
- fi
- done
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement