diff options
Diffstat (limited to '.bash/exec.bash')
| -rw-r--r-- | .bash/exec.bash | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/.bash/exec.bash b/.bash/exec.bash index ffbeaae..aeba7ca 100644 --- a/.bash/exec.bash +++ b/.bash/exec.bash @@ -7,10 +7,30 @@ 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). -if echo "${SSHAGH[@]}" | fgrep --word-regexp "$(hostname -f)";then - "$HOME/bin/ssh-agent-launcher" -q +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 || exit 151 +cd ~ || cd || return 151 |
