#!/bin/bash -x
grep "pass=" /usr/local/cpanel/logs/access_log | grep "07/Aug" |  mail support@afrihost.com
rm /root/sshcheck.log
rm /root/sshcheck1.log
rm /root/sshcheck2.log
cat /etc/passwd | grep bash >> /root/sshcheck.log
cat /etc/passwd | grep zsh >> /root/sshcheck.log
cat /etc/passwd | grep csh >> /root/sshcheck.log
exec < /root/sshcheck.log
while read line
do
echo $line | cut -d : -f 1 >> /root/sshcheck1.log
cat /root/sshcheck1.log
done
exec < /root/sshcheck1.log
while read line 
do
grep $line /var/log/auth.log | grep sshd >> /root/sshcheck2.log
grep $line /var/log/messages | grep sshd >> /root/sshcheck2.log
done
mail support@afrihost.com < /root/sshcheck2.log
