Rework sample code which sets SSH_AUTH_SOCK to the user's ssh-agent

socket path if running

PR:		167932
Submitted by:	madpilot (pr)
Submitted by:	wblock (final patch)
Reviewed by:	If someone else reviewed your modification.
Approved by:	cperciva (implicit)
MFC after:	3 days
This commit is contained in:
Eitan Adler 2012-05-15 20:15:17 +00:00
parent 5e1ba35cea
commit 06c34e294a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=235481
1 changed files with 1 additions and 1 deletions

View File

@ -5,7 +5,7 @@
# Sets SSH_AUTH_SOCK to the user's ssh-agent socket path if running
if (${?SSH_AUTH_SOCK} != "1") then
setenv SSH_AUTH_SOCK `sockstat | grep "${USER}" | cut -d ' ' -f 6`
setenv SSH_AUTH_SOCK `sockstat | grep "^${USER} " | awk '/ssh-agent/ { print $6 }'`
endif
# Change only root's prompt