Created
June 1, 2014 02:47
-
-
Save KhodeN/31af1b2f6be986f20fe7 to your computer and use it in GitHub Desktop.
Start PAGEANT.EXE (ssh-agent for windows) with all *.ppk, collected recursively
This file contains 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
import os | |
import sys | |
def get_files(only_ext): | |
for root, sub_folders, files in os.walk("."): | |
for file in files: | |
name, ext = os.path.splitext(file) | |
if ext == only_ext: | |
yield os.path.join(root, file)[2:] | |
pa_path = "..\\..\\PortableSoft\\putty\\PAGEANT.EXE" | |
keys = list(get_files(".ppk")) | |
#first (index 0) argument is program itself | |
os.execv(pa_path, [pa_path] + keys) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment