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 not found in the known_hosts file,
+# check the keyserver
+if [ -z "$hostKey" ] ; then
+ CHECK_KEYSERVER="true"
+fi
+
# update the known_hosts file for the host
monkeysphere update-known-hosts "$HOST"