freeswitch-reporter 675 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh
  2. email=traces@freeswitch.org
  3. errorlvl=1
  4. while [ $errorlvl -gt 0 ]
  5. do
  6. /usr/local/freeswitch/bin/freeswitch -core
  7. errorlvl=$?
  8. if [ $errorlvl -gt 0 ]; then
  9. pid=$(cat /usr/local/freeswitch/run/freeswitch.pid)
  10. corefile=core.$pid
  11. tempfile=$(tempfile)
  12. if [ -f $corefile ]; then
  13. reset
  14. echo From: freeswitch@jasongarland.com >>$tempfile
  15. echo >>$tempfile
  16. echo >>$tempfile
  17. echo Host: $(hostname -f) >>$tempfile
  18. gdb /usr/local/freeswitch/bin/freeswitch -c $corefile \
  19. --eval-command='set pagination off' \
  20. --eval-command='bt full' \
  21. --eval-command='quit' >>$tempfile
  22. cat $tempfile|rmail $email
  23. rm $tempfile
  24. fi
  25. fi
  26. #sleep 5s
  27. done