From 9780b18e08c6f36d8bb0de12fdcf4e6fff3ee123 Mon Sep 17 00:00:00 2001 From: "Andrew R. M" Date: Sat, 5 Apr 2025 16:37:09 -0400 Subject: [PATCH] Add conditional SSH config construction --- .gitignore | 1 + apply-dotfiles | 9 +++++++++ ssh/.ssh/config | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c27dffd..5857881 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ taskwarrior/.task/*.data +ssh/.ssh/extra.conf diff --git a/apply-dotfiles b/apply-dotfiles index 88a87ba..4eae179 100755 --- a/apply-dotfiles +++ b/apply-dotfiles @@ -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 < ssh/.ssh/extra.conf +EnableEscapeCommandline yes +CONFIG +fi apply_dotfile ssh restore_from_adoption diff --git a/ssh/.ssh/config b/ssh/.ssh/config index 2c767cc..ac02834 100644 --- a/ssh/.ssh/config +++ b/ssh/.ssh/config @@ -1 +1 @@ -EnableEscapeCommandline yes +Include ~/.ssh/extra.conf