]> arthur.barton.de Git - ax-zsh.git/blobdiff - plugins/ssh_macos/ssh_macos.zprofile
ssh_macos: Move to "zprofile" stage
[ax-zsh.git] / plugins / ssh_macos / ssh_macos.zprofile
diff --git a/plugins/ssh_macos/ssh_macos.zprofile b/plugins/ssh_macos/ssh_macos.zprofile
new file mode 100644 (file)
index 0000000..5f7dcd9
--- /dev/null
@@ -0,0 +1,12 @@
+# AX-ZSH: Alex' Modular ZSH Configuration
+# ssh_macos.zprofile: Additional configuration for SSH on Apple macOS X
+
+# Make sure that "ssh(1)" is installed.
+(( $+commands[ssh] )) || return 1
+
+# Test for macOS Sierra (10.12) or newer:
+[[ $(uname -s) = "Darwin" ]] || return 1
+[[ $(uname -r | cut -d'.' -f1) -ge 16 ]] || return 1
+
+# Load SSH keys from Keychain into SSH agent when the agent has no keys.
+ssh-add -l >/dev/null || ssh-add -A >/dev/null 2>&1