监控网页变化发送邮件通知
!/bin/bash
curl -X POST -d 'demo=20221212' http://web.demo.com/post.html| grep A50 > cache.txt
CHE=($(md5sum cache.txt cache2.txt))
DD=${CHE[0]}
XX=${CHE[2]}
if [ $DD == $XX ];
then
echo "no change"
else
echo "change"
echo "change" | mail -s change [email protected]
fi
time="+%Y-%m-%d %H:%M:%S"
echo $time >> logs.txt
判断是否为空
echo $AN
if [ -z "$AN" ];
then
echo "no change"
else
echo "change"
fi