create script/update-ssh-client-config
All checks were successful
bundlewrap/pipeline/head This commit looks good
All checks were successful
bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
65e6b8d053
commit
cfd0863671
1 changed files with 21 additions and 0 deletions
21
scripts/update-ssh-client-config
Executable file
21
scripts/update-ssh-client-config
Executable 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
|
||||
) &
|
Loading…
Reference in a new issue