This script will attempt to check the authentication details for an AP to see if they are correct. It should be called like so:
$ ruby wpa_auth_test.rb "FBISurveillanceVan4" "stingrays 4 eva"
I, [2000-01-02T02:36:27.925647 #14255] INFO -- : Starting WPA Supplicant
I, [2000-01-02T02:36:28.097044 #14255] INFO -- : Searching WPA log for authentication state
I, [2000-01-02T02:36:37.943307 #14255] INFO -- : Found authentication state in 10.02 seconds
I, [2000-01-02T02:36:37.947201 #14255] INFO -- : Killing WPA on PID 14268
E, [2000-01-02T02:36:37.961020 #14255] ERROR -- : Authentication failed