Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add ssh-reagent bash function

  • Loading branch information...
commit 3efacb3e1d765bde97e554fa39ec36de7b5c8b8b 1 parent 53f73d9
authored

Showing 1 changed file with 13 additions and 0 deletions. Show diff stats Hide diff stats

  1. 13  bash/reagent.sh
13  bash/reagent.sh
... ...
@@ -0,0 +1,13 @@
  1
+#!/bin/bash
  2
+
  3
+function ssh-reagent {
  4
+    for agent in /tmp/ssh-*/agent.*; do
  5
+        export SSH_AUTH_SOCK=$agent
  6
+        if ssh-add -l 2>&1 > /dev/null; then
  7
+            echo Found working SSH Agent:
  8
+            ssh-add -l
  9
+            return
  10
+        fi
  11
+    done
  12
+    echo Cannot find ssh agent - maybe you should reconnect and forward it?
  13
+}

0 notes on commit 3efacb3

Please sign in to comment.
Something went wrong with that request. Please try again.