Skip to content

Instantly share code, notes, and snippets.

@mcustiel
Created January 11, 2016 12:15
Show Gist options
  • Save mcustiel/65f3f0eebea458f4b1c0 to your computer and use it in GitHub Desktop.
Save mcustiel/65f3f0eebea458f4b1c0 to your computer and use it in GitHub Desktop.
Cmder: Auto start ssh-agent on first login to cmder.
tasklist /FI "IMAGENAME eq ssh-agent.exe" 2>NUL | grep 'ssh-agent.exe' >NUL
@if "%ERRORLEVEL%"=="0" (
echo ssh-agent is running
call %CMDER_ROOT%\vendor\call.cmd
) else (
ssh-agent | grep -v echo | sed -e "s/^/@set /" | sed -e "s/;.*$//" - > %CMDER_ROOT%\vendor\call.cmd
call %CMDER_ROOT%\vendor\call.cmd
ssh-add %USERPROFILE%\.ssh\ppk\id_rsa :: Add private keys here
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment