Add conditional SSH config construction

This commit is contained in:
Andrew R. M 2025-04-04 17:42:35 +00:00
parent b7886df942
commit dfb0c08a0f
3 changed files with 11 additions and 1 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
taskwarrior/.task/*.data
ssh/.ssh/extra.conf

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

View File

@ -1 +1 @@
EnableEscapeCommandline yes
Include ~/.ssh/extra.conf