Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. #! /bin/bash
  2. #Script to logout dynamic agents from Queue for CUC
  3.  
  4. MEMID=`/usr/sbin/asterisk -rx "queue show 2017" | grep "from-queue" | cut -d "(" -f2 | cut -d " " -f1`
  5. echo $MEMID
  6. if [ -z "$MEMID" ]
  7. then
  8. echo "No agents in the Queue 2017, quitting"
  9. #logger "No agents in the Queue 2017, quitting"
  10. exit
  11. else
  12. for i in $MEMID
  13. do
  14. echo "Removing $i from Queue 2017"
  15. #logger "Removing $i from Queue 2017"
  16. VAR=`/usr/sbin/asterisk -rx "queue remove member $i from 2017"`
  17. echo $VAR
  18. if [ "$VAR" = "Removed interface $i from queue '2017'" ]
  19. then
  20. echo "$i successfully removed from Queue 2017"
  21. #logger "$i successfully removed from Queue 2017"
  22. else
  23. SUB="Queue remove member unsuccessful for CUC"
  24. BODY="There was an error while logging out dynamic agents from Queue 2017 for CUC"
  25. echo "$BODY" | /bin/mail -s "$SUB" -r pbx.cucompanies.com deepa@openipsolutions.com
  26. fi
  27. done
  28. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement