#!/usr/bin/env bash
> /var/updresult.ini.watch
oldupdresult256=""
watchFileResult=xxxx
monitoredFile=xxx
while true
do
date >> $watchFileResult
updresult256=`sha256sum $monitoredFile 2>&1 | awk '{print $1}'`
if [ "$updresult256" != "$oldupdresult256" ];then
echo "begin print updresult==================" >> $watchFileResult
cat $monitoredFile >> $watchFileResult 2>&1
echo "end print updresult==================" >> $watchFileResult
fi
oldupdresult256=$updresult256
ll $monitoredFile >> $watchFileResult 2>&1
grep SysUpdStatus $monitoredFile >> $watchFileResult 2>&1
grep UpdPkgType $monitoredFile >> $watchFileResult 2>&1
sleep 1
done
> /var/updresult.ini.watch
oldupdresult256=""
watchFileResult=xxxx
monitoredFile=xxx
while true
do
date >> $watchFileResult
updresult256=`sha256sum $monitoredFile 2>&1 | awk '{print $1}'`
if [ "$updresult256" != "$oldupdresult256" ];then
echo "begin print updresult==================" >> $watchFileResult
cat $monitoredFile >> $watchFileResult 2>&1
echo "end print updresult==================" >> $watchFileResult
fi
oldupdresult256=$updresult256
ll $monitoredFile >> $watchFileResult 2>&1
grep SysUpdStatus $monitoredFile >> $watchFileResult 2>&1
grep UpdPkgType $monitoredFile >> $watchFileResult 2>&1
sleep 1
done