From ohcanada, 3 Weeks ago, written in Ruby.
  1. #!/usr/bin/env ruby
  2.  
  3. # loginauth.rb - silently check a username & password combo
  4.  
  5. require 'rpam'
  6.  
  7. if ARGV.length != 2
  8.   exit 1
  9. end
  10.  
  11. username = ARGV[0]
  12. password = ARGV[1]
  13.  
  14. if Rpam.auth(username, password)
  15.   exit 0
  16. else
  17.   exit 1
  18. end
captcha