Created
January 31, 2009 12:57
-
-
Save jasonrudolph/55536 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Grab a password out of the 1Password keychain...finding it by "name" | |
def password_for_hostname(name) | |
password_info = `security 2>&1 >/dev/null find-generic-password -gs passwords.Password:#{name} 1Password.keychain` | |
password = password_info.match(/\"\:\"(.+)\"\}\"/)[1] rescue nil | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment