Cleaned/fix up update-userid function. also some general cleanup.
[monkeysphere.git] / src / monkeysphere-ssh-proxycommand
1 #!/bin/sh -e
2
3 # monkeysphere-ssh-proxycommand: MonkeySphere ssh ProxyCommand hook
4 #
5 # The monkeysphere scripts are written by:
6 # Jameson Rollins <jrollins@fifthhorseman.net>
7 #
8 # They are Copyright 2008, and are all released under the GPL, version 3
9 # or later.
10
11 # This is meant to be run as an ssh ProxyCommand to initiate a
12 # monkeysphere known_hosts update before an ssh connection to host is
13 # established.  Can be added to ~/.ssh/config as follows:
14 #  ProxyCommand monkeysphere-ssh-proxycommand %h %p
15
16 HOST="$1"
17 PORT="$2"
18
19 # update the known_hosts file for the host
20 monkeysphere update-known-hosts "$HOST"
21
22 # exec a netcat passthrough to host for the ssh connection
23 exec nc "$HOST" "$PORT"