diff --git a/ssh/epilogue b/ssh/epilogue index d630445..82fb352 100644 --- a/ssh/epilogue +++ b/ssh/epilogue @@ -1,4 +1,4 @@ -Host gitea gitea.* github.com gitlab.com *.github.com *.gitlab.com +Match canonical Host gitea,gitea.*,github.com,gitlab.com,*.github.com,*.gitlab.com User git diff --git a/ssh/gen-search.sh b/ssh/gen-search.sh index a65b93f..effb4df 100755 --- a/ssh/gen-search.sh +++ b/ssh/gen-search.sh @@ -3,9 +3,9 @@ rm -f ~/.ssh/search if [ -e ${CSHENV_DIR}/ssh/ssh-search-domains ] then - domains=`grep "^search" /etc/resolv.conf | cut -c 8- - | cat - ${CSHENV_DIR}/ssh/ssh-search-domains | xargs` + domains=`grep "^search" /etc/resolv.conf | cut -c 8- - | cat - ${CSHENV_DIR}/ssh/ssh-search-domains | sort -u | xargs` else - domains=`grep "^search" /etc/resolv.conf | cut -c 8- - | xargs` + domains=`grep "^search" /etc/resolv.conf | cut -c 8- - | sort -u | xargs` fi if [ -z "${domains}" ] ; then exit 1; fi diff --git a/ssh/prologue b/ssh/prologue index 0dac0ad..f0cf5f0 100644 --- a/ssh/prologue +++ b/ssh/prologue @@ -3,7 +3,7 @@ # # That config uses Canonicalization to emulate what your local resolver # does in these circumstances. -Match exec "~/cshenv/ssh/gen-search.sh" +Match !canonical !final exec "~/cshenv/ssh/gen-search.sh" Include ~/.ssh/search # vim: ft=sshconfig diff --git a/startup_hooks/install.sh b/startup_hooks/install.sh index d5e8fa5..e9002fe 100755 --- a/startup_hooks/install.sh +++ b/startup_hooks/install.sh @@ -73,5 +73,6 @@ echo "" >> ~/.gitconfig echo "[commit]" >> ~/.gitconfig echo " gpgSign = true" >> ~/.gitconfig -echo "Do not forget to add the following line at the top of your ssh config:" -echo "Include ${CSHENV_LOCATION}/ssh/config" +echo "Do not forget to add the following lines at the top and bottom of your ssh config:" +echo "Match all\n Include ${CSHENV_LOCATION}/ssh/config" +echo "Match all\n Include ${CSHENV_LOCATION}/ssh/config"