From 5b4e7570c624a548cab56e02f1ee5b8feec6d3bc Mon Sep 17 00:00:00 2001 From: Viktor Jackson Date: Mon, 8 Jul 2013 01:04:48 +0200 Subject: [PATCH] Fix: source ssh-agent vars on login --- modules/ssh-envoy/init.zsh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/ssh-envoy/init.zsh b/modules/ssh-envoy/init.zsh index 32b381ff..5336da3c 100644 --- a/modules/ssh-envoy/init.zsh +++ b/modules/ssh-envoy/init.zsh @@ -23,6 +23,15 @@ if [[ `systemctl show envoy --property=ActiveState` != "ActiveState=active" ]]; else /usr/bin/envoy -t ssh-agent fi + + # Check envoyd status again + if [[ `systemctl show envoy --property=ActiveState` != "ActiveState=active" ]]; then + source <(/usr/bin/envoy -p) # get ssh env vars + else + # envoyd isn't running, print an error message and return + echo "We had trouble starting envoy. Check 'systemctl status envoy' as root." + return 1 + fi else for _ssh_id in $_ssh_identities @@ -35,3 +44,4 @@ else fi done fi +