]> arthur.barton.de Git - ax-zsh.git/blob - plugins/ssh_macos/ssh_macos.zprofile
P10k: Read config after enabling instant prompt
[ax-zsh.git] / plugins / ssh_macos / ssh_macos.zprofile
1 # AX-ZSH: Alex' Modular ZSH Configuration
2 # ssh_macos.zprofile: Additional configuration for SSH on Apple macOS X
3
4 # Make sure that "ssh(1)" is installed.
5 (( $+commands[ssh] )) || return 1
6
7 # Test for macOS Sierra (10.12) or newer:
8 [[ $(uname -s) = "Darwin" ]] || return 1
9 [[ $(uname -r | cut -d'.' -f1) -ge 16 ]] || return 1
10
11 # Make sure that an SSH agent is available (but ignore failure):
12 [[ -n "$SSH_AUTH_SOCK" ]] || return 0
13
14 # Start a backgroud job that tries to load the SSH keys from Keychain into
15 # the SSH agent, when the agent has no keys.
16 ssh-add -l >/dev/null || ssh-add -A >/dev/null 2>&1 &!