Add conditional SSH config construction

This commit is contained in:
2024-02-08 14:53:17 +00:00
parent dd35fe3b20
commit ed9e0d4419
3 changed files with 11 additions and 1 deletions

View File

@@ -21,6 +21,15 @@ apply_dotfile vim
apply_dotfile ruby
apply_dotfile python
# Check that SSH version is above 9.2 (where EnableEscapeCommandline was added) before conditionally adding
# a config file. This is then included in the main config
SSH_VERSION=$(ssh -V 2>&1 | cut -d',' -f 1 | cut -d '_' -f 2)
if [[ "${SSH_VERSION}" =~ ^9\.[1-9]{0,1}[2-9].*$ ]]; then
cat <<CONFIG > ssh/.ssh/extra.conf
EnableEscapeCommandline yes
CONFIG
fi
apply_dotfile ssh
restore_from_adoption