From 5afe534d9cf5dfa28864571fe4b88ce8936d8c00 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sat, 28 Dec 2024 12:32:27 +0100 Subject: [PATCH] scripts/update-ssh-client-config: add configurable extra line --- scripts/update-ssh-client-config | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/update-ssh-client-config b/scripts/update-ssh-client-config index 0c2f7fd..dc86661 100755 --- a/scripts/update-ssh-client-config +++ b/scripts/update-ssh-client-config @@ -12,10 +12,20 @@ BW_TABLE_STYLE=grep bw nodes -a hostname -- "lambda:not node.dummy" | \ while read node addr do + if [[ -z "$BW_SSH_HOOK_EXTRA_LINE" ]] + then + echo "Host $addr" >>"$tmpfile" + echo "$BW_SSH_HOOK_EXTRA_LINE" >>"$tmpfile" + echo "" >>"$tmpfile" + fi echo "Host $node" >>"$tmpfile" echo "HostName $addr" >>"$tmpfile" + if [[ -z "$BW_SSH_HOOK_EXTRA_LINE" ]] + then + echo "$BW_SSH_HOOK_EXTRA_LINE" >>"$tmpfile" + fi echo "" >>"$tmpfile" done - mv "$tmpfile" ~/.ssh/bwnodes + mv "$tmpfile" ~/.ssh/config.d/bwnodes ) &