echo `date` >> /var/tmp/ssh_tex.log
echo $SSH_CONNECTION >> /var/tmp/ssh_tex.log

SSH_REMOTE=`echo $SSH_CLIENT | egrep '192.168.0.24'`
if [ "$USER" = "tex" ] && [ "$SSH_REMOTE" = "" ]; then
    echo "NOT FROM DOTTWENTYFOUR" >> /var/tmp/ssh_tex.log
    echo "To: <email address>" > /var/tmp/hmail.txt
    echo "From: <email address>" >> /var/tmp/hmail.txt
    echo "Subject: <SERVERNAME Login" >> /var/tmp/hmail.txt
    echo "$SSH_CONNECTION" >> /var/tmp/hmail.txt
    echo "." >> /var/tmp/hmail.txt
    touch /var/tmp/login
    logout
fi
