I keep getting this error message running this script. What is causing it?
Line 18 is the last line in the file which I think is a CR.
./Boa404Chk.sh: line 18: syntax error: unexpected end of file
#!/bin/bash
if diff /var/log/boa/access_log /etc/boa_access_bkp >/dev/null
then
exit 0
else
cat /var/log/boa/access_log > /etc/boa_access_bkp
if grep -q '404' '/var/log/boa/access_log'
then
sed 's/404$/===404===/g' '/var/log/boa/access_log > /etc/boa_access_bkp
cd
cat /etc/boa_access_bkp | mail -s "BOA 404 in access_log"
me@myisp.net &> /dev/null
cat /etc/boa_access_bkp >> boa_access_dttlbkp #save to send at EOD
cat /dev/null > /var/log/boa/access_log
cat /dev/null > /etc/boa_access_bkp
fi
fi