aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2016-03-17 18:54:18 +0100
committerDuncaen <mail@duncano.de>2016-03-17 19:01:28 +0100
commita8cec0197a28b6a5e3793eb2a11b002fcf3ac59d (patch)
tree0775cc7ec65b2da49ff2fb1943f033be620d6388
parent06e0cde4ff9ea046e6e2d7b4f00623d81ccf1a9c (diff)
downloaddotfiles-a8cec0197a28b6a5e3793eb2a11b002fcf3ac59d.tar.gz
add ssh-agent config
-rwxr-xr-xmksh.d/00-ssh-agent.sh9
l---------service/ssh-agent1
-rwxr-xr-xsv/ssh-agent/check0
-rwxr-xr-xsv/ssh-agent/finish5
-rwxr-xr-xsv/ssh-agent/run4
5 files changed, 19 insertions, 0 deletions
diff --git a/mksh.d/00-ssh-agent.sh b/mksh.d/00-ssh-agent.sh
new file mode 100755
index 0000000..f480da7
--- /dev/null
+++ b/mksh.d/00-ssh-agent.sh
@@ -0,0 +1,9 @@
+source_ssh_agent() {
+ [ -r ~/.cache/ssh-agent-info ] && . ~/.cache/ssh-agent-info
+}
+
+check_ssh_agent() {
+ test -e "/proc/${SSH_AUTH_SOCK#*.}"
+}
+
+[ ! "$SSH_AUTH_SOCK" ] && source_ssh_agent
diff --git a/service/ssh-agent b/service/ssh-agent
new file mode 120000
index 0000000..a233f07
--- /dev/null
+++ b/service/ssh-agent
@@ -0,0 +1 @@
+/home/duncan/sv/ssh-agent/ \ No newline at end of file
diff --git a/sv/ssh-agent/check b/sv/ssh-agent/check
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/sv/ssh-agent/check
diff --git a/sv/ssh-agent/finish b/sv/ssh-agent/finish
new file mode 100755
index 0000000..a562b6a
--- /dev/null
+++ b/sv/ssh-agent/finish
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+[ -r ./conf ] && . ./conf
+rm -f ${SSH_AGENT_INFO_FILE:=~/.cache/ssh-agent-info}
+exit 0
diff --git a/sv/ssh-agent/run b/sv/ssh-agent/run
new file mode 100755
index 0000000..7fa46d2
--- /dev/null
+++ b/sv/ssh-agent/run
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+[ -r ./conf ] && . ./conf
+exec ssh-agent -D > ${SSH_AGENT_INFO_FILE:=~/.cache/ssh-agent-info}