#!/bin/sh # # Copyright 1999-2006 University of Chicago # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # url_string=$1 remote_host=$2 port=$3 user=$4 port_str="" if [ "X" = "X$port" ]; then port_str="" else port_str=" -p $port " fi if [ "X" != "X$user" ]; then remote_host="$user@$remote_host" fi remote_default1=.globus/sshftp remote_default2=/etc/grid-security/sshftp remote_fail="echo -e 500 Server is not configured for SSHFTP connections.\\\r\\\n" remote_program=$GLOBUS_REMOTE_SSHFTP if [ "X" = "X$remote_program" ]; then remote_program="(( test -f $remote_default1 && $remote_default1 ) || ( test -f $remote_default2 && $remote_default2 ) || $remote_fail )" fi if [ "X" != "X$GLOBUS_SSHFTP_PRINT_ON_CONNECT" ]; then echo "Connecting to $1 ..." >/dev/tty fi exec /usr/bin/ssh $port_str $remote_host $remote_program