-
-
Save justinAurand/076cc3468a5af6c6c1b6718bcd438b1d to your computer and use it in GitHub Desktop.
Run pageant and add keys on Cmder startup
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
setlocal ENABLEDELAYEDEXPANSION | |
set ssh_key_home=%HOME%\.ssh\ | |
set pageant_key_wildcard=*.ppk | |
echo Gathering keys matching %pageant_key_wildcard% in ^ | |
%ssh_key_home% | |
rem Check if pageant is running | |
for /f "tokens=2 delims=," %%F in ('tasklist /nh /fi "imagename eq PAGEANT.EXE" /fo csv') do ( | |
set pageant_pid=%%F | |
) | |
echo Starting pageant | |
if "%pageant_pid%" == "" (start pageant.exe) | |
rem Get pageant style keys | |
for /f "tokens=*" %%I in ('DIR /B "%ssh_key_home%%pageant_key_wildcard%"') do ( | |
echo Adding key %ssh_key_home%%%%I | |
pageant "%ssh_key_home%%%I" | |
) | |
endlocal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is awesome!
I searched for an ethernity to get this running :)