scan_log_for_warnings.sh 397 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. LOG=$(tpsgi-config --custom_log)
  3. if [ -f $LOG ]
  4. then
  5. grep 'starman:' $LOG
  6. touch warnings.log
  7. FSZ=$(stat --printf "%s" warnings.log)
  8. grep -oP 'starman:\s+.*' $LOG >> warnings.log
  9. echo "$(sort < warnings.log | uniq)" > warnings.log
  10. NEWSZ=$(stat --printf "%s" warnings.log)
  11. if [ $FSZ != $NEWSZ ]
  12. then
  13. echo "New warning from tPSGI, investigate $LOG!"
  14. cat warnings.log
  15. fi
  16. fi