scripts/update-ssh-client-config: add configurable extra line

This commit is contained in:
Franzi 2024-12-28 12:32:27 +01:00
parent 3e6872c96b
commit 5afe534d9c
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -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
) &