w10install/tools/start-ssh-agent.cmd
Michael H.G. Schmidt 2a6e6dee1c restructured
2021-02-27 20:07:28 +01:00

19 lines
474 B
Batchfile

@echo off
set TOOLS=c:\tools
rem set SOCKET for "ssh-add" ...
echo set SSH_AUTH_SOCK=%TEMP%\ssh-agent.txt
set SSH_AUTH_SOCK=%TEMP%\ssh-agent.txt
set GIT_SSH=%TOOLS%\git\usr\bin\ssh.exe
tasklist /FI "USERNAME eq %USERNAME%" /FI "IMAGENAME eq ssh-agent.exe" | findstr ssh-agent.exe
IF %ERRORLEVEL% GTR 0 (
attrib -S %TEMP%\ssh-agent.txt
del /f /s /q %TEMP%\ssh-agent.txt 1>nul 2>nul
ssh-agent -a %TEMP%\ssh-agent.txt
ssh-add
) ELSE (
echo SSH agent is running.
)