check_system.sh

  1. #!/bin/sh
  2.  
  3. MAILTO="someone@somewhere.de"
  4. [ `type -p /sbin/md5sum 2>/dev/null` ] && MD5='/sbin/md5sum' || MD5='/sbin/md5'
  5.  
  6. find / '(' -path '*/sbin/*' -o -path '*/bin/*' -o -path '*/etc/*' ')' \
  7.   -type f -print | xargs "${MD5}" | gzip -9c | mmencode -b | sed "1i\\
  8. To: ${MAILTO}\\
  9. Subject: System Checksum `date`\\
  10. MIME-Version: 1.0\\
  11. Content-Type: multipart/mixed; boundary=__grenze__\\
  12. \\
  13. --__grenze__\\
  14. Content-Type: application/x-gzip; name=\"chksum.txt.gz\";\\
  15. Content-Transfer-Encoding: base64\\
  16. Content-Disposition: attachment; file_name=\"chksum.txt.gz\"\\
  17. \$a\\
  18. --__grenze__--
  19. " | /usr/sbin/sendmail -t