Results 1 to 30 of 113

Hybrid View

  1. Collapse Details
     
    #1
    le Gentleman Doli's Avatar
    Join Date
    Mar 2012
    Posts
    9,939
    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.
    Reply With Quote
     

  2. Collapse Details
     
    #2
    DogManz maks's Avatar
    Join Date
    Dec 2011
    Location
    Lud, Midworld
    Posts
    99,256
    Quote Originally Posted by Gentleman Doli View Post
    There is no stare dog big enough for the win youve just created.
    I wrote that script.
    Reply With Quote
     

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •