bundlewrap/scripts/update-ssh-client-config
Franzi 358a1869f4
All checks were successful
bundlewrap/pipeline/head This commit looks good
script/update-ssh-client-config: s/post-receive/post-checkout/
2021-02-13 17:09:27 +01:00

22 lines
538 B
Bash
Executable file

#!/bin/bash
# Intended to be used as a git hook for post-commit, post-merge, post-checkout
#
# 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
) &