]> git.pld-linux.org Git - packages/openssh.git/blame - ssh-agent.sh
- rebuild with openssl-1.0.1k
[packages/openssh.git] / ssh-agent.sh
CommitLineData
864cd347 1#!/bin/sh
a778cb26 2# ssh-agent.sh is a sh/bash/zsh compatible script sourced from /etc/profile.d/
3# at user login. It reads configuration from /etc/ssh/ssh-agent.conf
4# or ~/.ssh/ssh-agent.conf if any exist and, depending on settings
5# in configuration file, runs ssh-agent with given options at first user login,
6# exports SSH_AGENT_PID SSH_AUTH_SOCK environment variables to all login
7# sessions. If ssh-agent is already started for given user, script exports only
8# SSH_AGENT_PID SSH_AUTH_SOCK to new user's login session.
9
1aa5aa68 10[ -f /etc/ssh/ssh-agent.conf ] && SSH_AGENT_CONF="/etc/ssh/ssh-agent.conf"
11[ -f "${HOME}/.ssh/ssh-agent.conf" ] && SSH_AGENT_CONF="${HOME}/.ssh/ssh-agent.conf"
864cd347 12if [ -s "$SSH_AGENT_CONF" ] ; then
13 . "$SSH_AGENT_CONF" || :
14 if [ "$ssh_agent_enable" = "yes" -o "$ssh_agent_enable" = "YES" ] ; then
15 SSH_AGENT_DATA="${HOME}/.ssh/SSH-AGENT-DATA"
16 if [ -s "$SSH_AGENT_DATA" ] ; then
17 . "$SSH_AGENT_DATA" > /dev/null
1204bb8a 18 if [ "$(ps uhp "$SSH_AGENT_PID" 2>/dev/null | awk '$1 ~ ENVIRON["USER"] {print $11}')" != "ssh-agent" ] ; then
a2a1f909 19 ssh-agent $ssh_agent_flags > "$SSH_AGENT_DATA"
864cd347 20 . "$SSH_AGENT_DATA" > /dev/null
21 fi
22 else
a2a1f909 23 ssh-agent $ssh_agent_flags > "$SSH_AGENT_DATA"
864cd347 24 . "$SSH_AGENT_DATA" > /dev/null
25 fi
26 fi
27fi
28
This page took 0.025527 seconds and 4 git commands to generate.