dotfiles

Personal dotfiles
git clone https://git.bracken.jp/dotfiles.git
Log | Files | Refs | LICENSE

commit 5f1e411e434de082f1b52315559dc17da9aae7d8
parent 6cf37eaed1e9a7ae82b458b55082a0fc277571b9
Author: Chris Bracken <chris@bracken.jp>
Date:   Thu, 31 Mar 2022 16:49:03 -0700

zprofile: only run ssh-agent manually on FreeBSD

This is generally handled by the login system on Linux, macOS, etc.

Diffstat:
M.zprofile | 26++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/.zprofile b/.zprofile @@ -3,17 +3,19 @@ # Set the terminal size if we're on a serial line. if [[ -x /usr/bin/resizewin ]]; then /usr/bin/resizewin -z; fi -# Add temporary environment. -DAEMON_RUNTIME_HOME="$HOME/.local/tmp" +if [[ "$(uname)" == "FreeBSD" ]]; then + # Add temporary environment. + DAEMON_RUNTIME_HOME="$HOME/.local/tmp" -# Start ssh-agent daemon. -export SSH_AUTH_SOCK="$DAEMON_RUNTIME_HOME/ssh-agent.sock" -ssh-add -l 2>/dev/null >/dev/null -if [ $? -ge 2 ]; then - mkdir -p "$DAEMON_RUNTIME_HOME" - eval $(ssh-agent -s -a "$SSH_AUTH_SOCK") > /dev/null - trap 'ssh-agent -k > /dev/null' EXIT -fi + # Start ssh-agent daemon. + export SSH_AUTH_SOCK="$DAEMON_RUNTIME_HOME/ssh-agent.sock" + ssh-add -l 2>/dev/null >/dev/null + if [ $? -ge 2 ]; then + mkdir -p "$DAEMON_RUNTIME_HOME" + eval $(ssh-agent -s -a "$SSH_AUTH_SOCK") > /dev/null + trap 'ssh-agent -k > /dev/null' EXIT + fi -# Clean up temporary environment. -unset DAEMON_RUNTIME_HOME + # Clean up temporary environment. + unset DAEMON_RUNTIME_HOME +fi