bundlewrap/scripts/update-ssh-client-config
Franziska Kunsmann cfd0863671
All checks were successful
bundlewrap/pipeline/head This commit looks good
create script/update-ssh-client-config
2021-02-13 16:39:55 +01:00

21 lines
537 B
Bash
Executable file

#!/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
) &