17249667879ca7e5b6f37eb7d314a1ba89e35f9d
[monkeysphere.git] / src / monkeysphere-ssh-proxycommand
1 #!/bin/sh -e
2
3 # MonkeySphere ssh ProxyCommand hook
4 # Proxy command script to initiate a monkeysphere known_hosts update
5 # before an ssh connection to host is established.
6 # Can be added to ~/.ssh/config as follows:
7 # ProxyCommand monkeysphere-ssh-proxycommand %h %p
8
9 HOST="$1"
10 PORT="$2"
11
12 # update the known_hosts file for the host
13 monkeysphere update-known-hosts "$HOST"
14
15 # make a netcat connection to host for the ssh connection
16 exec nc "$HOST" "$PORT"