shell 入侵检测与邮件告警

#!/bin/bash
webdir=/var/www/html
cd $webdir#方法1 MD5sum校验
#md5sum /var/www/html/index.html >/opt/webfile.db
md5sum -c --quiet /opt/webfile.db
if [ $? -eq 0 ]; then
echo “web file is ok”
else
echo “”
#mail -s “web file is change!” [email protected]
fi
##方法2 web目录下文件数是否有变动
#find /var/www/html/ -type f >/opt/countfile.db_sec
find /var/www/html/ -type f >/opt/countfile.db
count=diff /opt/countfile.db*|wc -l
if [ $count -gt 0 ]; then
echo “the file_count is changed”
#mail -s “count_err” [email protected]
else
echo “ok”
fi
shell 入侵检测与邮件告警

相关文章:

  • 2021-10-06
  • 2021-06-26
  • 2021-09-07
  • 2021-05-11
  • 2021-08-07
  • 2021-10-22
  • 2021-05-29
  • 2021-07-16
猜你喜欢
  • 2021-09-03
  • 2022-01-15
  • 2021-08-30
  • 2021-05-31
  • 2022-03-10
  • 2021-12-26
相关资源
相似解决方案