Quote Originally Posted by maks View Post
oh we're doing that now?


[ "$PAM_TYPE" = "open_session" ] || exit 0
#create the mail template
echo "Here's the last 2 lines from /var/log/auth.log" >> /tmp/authmail.txt
# grab the last two lines of the log
tail -n 2 /var/log/auth.log >> /tmp/authmail.txt
# convert to DOS linefeeds
awk 'sub("$", "\r")' /tmp/authmail.txt > /tmp/authmail2.txt
cat /etc/skel/mailtemplate.txt /tmp/authmail2.txt|ssmtp {email address} -au support -ap {password masked for purposes of emailing this}
rm -rf /tmp/authmail*
There is no stare dog big enough for the win youve just created.