Created
March 4, 2017 00:36
-
-
Save technomancy/0cb4ba11bc4dc60b8b300fcbff8614b7 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
| #!/usr/bin/python | |
| import re, os | |
| def get_authinfo_password(machine, login): | |
| s = "machine %s login %s password ([^ ]*)\n" % (machine, login) | |
| p = re.compile(s) | |
| authinfo = os.popen("gpg -q --no-tty -d ~/.authinfo.gpg").read() | |
| return p.search(authinfo).group(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment