Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

how to check ssh agent is running in git bash

# Set up ssh-agent
SSH_ENV="$HOME/.ssh/environment"

function start_agent {
    echo "Initializing new SSH agent..."
    touch $SSH_ENV
    chmod 600 "${SSH_ENV}"
    /usr/bin/ssh-agent | sed 's/^echo/#echo/' >> "${SSH_ENV}"
    . "${SSH_ENV}" > /dev/null
    /usr/bin/ssh-add
}

# Source SSH settings, if applicable
if [ -f "${SSH_ENV}" ]; then
    . "${SSH_ENV}" > /dev/null
    kill -0 $SSH_AGENT_PID 2>/dev/null || {
        start_agent
    }
else
    start_agent
fi
Comment

PREVIOUS NEXT
Code Example
Shell :: how to assign more than one ip address in linux 
Shell :: shell save variable 
Shell :: printf in bash 
Shell :: api to access gitlab varaible 
Shell :: docker db instance workbench connection 
Shell :: github howto contribute fork 2 commits behind 
Shell :: bash script expand string on spaces 
Shell :: wsl localhost not working 
Shell :: git rename older local commit 
Shell :: installer-snap change in progress 
Shell :: git push http access denied 
Shell :: docker get in python container 
Shell :: how to install raspap 
Shell :: View Commit History With Changes in git command 
Shell :: docker-proxy port 80 
Shell :: magento 2.4 install command line 
Shell :: git create branch without initial commit 
Shell :: txt file open command linux 
Shell :: git flow 
Shell :: install nodejs via homebrew 
Shell :: Update /etc/apt/sources.list file 
Shell :: Add a Remote Repository in git command 
Shell :: how to uninstall kite 
Shell :: commit your changes 
Shell :: save terminal output to file with script 
Shell :: cp command 
Shell :: Bootable flash from ubuntu terminal 
Shell :: how to save curl output to a file 
Shell :: upload on s3 
Shell :: jetbrains always add disable 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =