nixos/extra_installers/ssh-agent.sh

10 lines
474 B
Bash
Executable file

#! /usr/bin/env bash
# SSH agent
ssh_agent_export="export SSH_AUTH_SOCK=\"\$XDG_RUNTIME_DIR/ssh-agent.socket\""
grep "$ssh_agent_export" "$HOME/.profile" > /dev/null || echo "$ssh_agent_export" >> "$HOME/.profile"
grep "$ssh_agent_export" "$HOME/.zprofile" > /dev/null || echo "$ssh_agent_export" >> "$HOME/.zprofile"
grep "$ssh_agent_export" "$HOME/.bash_profile" > /dev/null || echo "$ssh_agent_export" >> "$HOME/.bash_profile"
systemctl --user enable ssh-agent.service