create script/update-ssh-client-config
All checks were successful
bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2021-02-13 16:39:55 +01:00
parent 65e6b8d053
commit cfd0863671
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -0,0 +1,21 @@
#!/bin/bash
# Intended to be used as a git hook for post-commit, post-merge, post-receive
#
# Remember to include the generated ssh config on top of ~/.ssh/config:
# Include ~/.ssh/bwnode
(
tmpfile=$(mktemp -p ~/.ssh/)
echo "# generated $(date)" >"$tmpfile"
BW_TABLE_STYLE=grep bw nodes -a hostname -- "lambda:not node.dummy" | \
while read node addr
do
echo "Host $node" >>"$tmpfile"
echo "HostName $addr" >>"$tmpfile"
echo "" >>"$tmpfile"
done
mv "$tmpfile" ~/.ssh/bwnodes
) &