diff options
author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2008-06-17 13:34:32 -0400 |
---|---|---|
committer | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2008-06-17 13:34:32 -0400 |
commit | 92c70306aa5f96c8dfa69f2c90dca58908e719f7 (patch) | |
tree | 4f7d220ec09f4364509d909844b56c61222c1596 /src/monkeysphere-ssh-proxycommand | |
parent | 9715df03ccc1620db97d3fea50e5031f6ed36fde (diff) | |
parent | deb41134ca527508253244cfa8860a2031034825 (diff) |
Merge commit 'jrollins/master'
Diffstat (limited to 'src/monkeysphere-ssh-proxycommand')
-rwxr-xr-x | src/monkeysphere-ssh-proxycommand | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/monkeysphere-ssh-proxycommand b/src/monkeysphere-ssh-proxycommand index 417d013..3887e48 100755 --- a/src/monkeysphere-ssh-proxycommand +++ b/src/monkeysphere-ssh-proxycommand @@ -16,6 +16,37 @@ HOST="$1" PORT="$2" +usage() { +cat <<EOF >&2 +usage: ssh -o ProxyCommand="$(basename $0) %h %p" ... +EOF +} + +log() { + echo "$@" >&2 +} + +if [ -z "$HOST" ] ; then + log "host must be specified." + usage + exit 1 +fi +if [ -z "$PORT" ] ; then + log "port must be specified." + usage + exit 1 +fi + +# check for the host key in the known_hosts file +hostKey=$(ssh-keygen -F "$HOST") + +# if the host key is found in the known_hosts file, +# don't check the keyserver +if [ "$hostKey" ] ; then + CHECK_KEYSERVER="false" +fi +export CHECK_KEYSERVER + # update the known_hosts file for the host monkeysphere update-known-hosts "$HOST" |