server 289 B

123456789101112131415161718
  1. #!/bin/bash
  2. source config.sh
  3. echo >q.txt
  4. log1 =`cat /var/nginx/log/error.log`
  5. log2=`cat q.txt`
  6. if [ "$log1" = "$log2" ]
  7. then
  8. q=1
  9. else
  10. echo """
  11. hi
  12. i'm clara. a server Manager bot
  13. you Have Error in your web server
  14. Error:
  15. $log1
  16. """ | mail -s "Error" $email
  17. echo >/var/log/nginx/error.log