daily pastebin goal
57%
SHARE
TWEET

Untitled

a guest Jul 17th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /usr/bin/env bash
  2.  
  3. SSH_ENV="$HOME/.ssh/env"
  4. start_ssh_agent()
  5. {
  6.     echo "Initialising new SSH agent..."
  7.     ssh-agent -s | sed 's/^echo/#echo/' > "${SSH_ENV}"
  8.     chmod 600 "${SSH_ENV}"
  9.     source "${SSH_ENV}" > /dev/null 2>&1
  10.     ssh-add
  11. }
  12.  
  13. # Source SSH settings, if applicable
  14. if [ -f "${SSH_ENV}" ]; then
  15.     source "${SSH_ENV}" > /dev/null 2>&1
  16.     ps -p ${SSH_AGENT_PID} > /dev/null 2>&1 || start_ssh_agent
  17. else
  18.     start_ssh_agent
  19. fi
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top