Code:
file=/tmp/test
ok=0
cmp /tmp/1 /tmp/2 &> /dev/null && ok=1
if [[ $ok -eq 1 ]]
then
echo "fail check ok"
while [ ! -s $file ]; do
echo "$file is empty"
wget http://link -O /tmp/test
sleep 3
done
cat /tmp/test
else
echo "fail check fail"
# do some action
fi