blob: aeba7ca47c26b70f8116211d0621c28bf1a21dce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#!/usr/bin/env bash
# vim:syntax=sh
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
set bell-style visible
# start ssh agent. this script will not try to run a new instance
# (unless we specified -f, which we don't).
SSHRUN=0
case "$OSNAME" in
'sunos')
if echo "${SSHAGH[@]}" | grep -E "^$(cat /etc/nodename)\$" > /dev/null; then
SSHRUN=1
fi
;;
*)
if echo "${SSHAGH[@]}" | grep -F --word-regexp "$(hostname -f)" > /dev/null;then
SSHRUN=1
fi
;;
esac
if [ "$SSHRUN" -eq 1 ]; then
# do not launch from SSH session, conflicts with user logging on locally afterwards
if [ -z "$SSH_TTY" ];then
"$HOME/bin/ssh-agent-launcher" -q
if ! pgrep -au "$(id -u)" dirmngr >/dev/null;then
gpg-connect-agent --dirmngr /bye 2>/dev/null
gpg --list-secret-keys >/dev/null 2>&1
fi
fi
fi
# because on some hosts the login path is fucked, unset in .local
# if it causes irritation:
cd ~ || cd || return 151
|