telnetting without a telnet module

H

Howard

Hello everyone,
i was wondering if anybody knew how to "telnet" to another machine
to get a file, but the machine that i am using and the machine i am
targetting both do not have the telnet module. Thanks


Howard
 
G

GIMME

Why don't you run Perl from ANT and then have ANT handle the ftp task
?

ANT will allow you to telnet to a remote host and to execute an
ftp from there to yet another remote host. So you can get around
a firewall.

Something like ...

<project name="Manifest" basedir="." default="Doc" >

<property file="${JobName}/job.properties"/>
<property name="JobOrderOutput" value="${JobOrderRoot}/job_output"/>
<property name="Perl" value="/usr/local/bin/perl"/>
<property name="JobOrderPerl" value="${JobOrderRoot}/perl"/>
<property name="JobOrderPerlLib" value="${JobOrderRoot}/lib"/>

<target name="RunPerl">
<echo message="exc : ${Perl} -I${JobOrderPerlLib}
${JobOrderPerl}/${JobScript} ${JobOrderOutput} ${JobOrderArgs}"/>
<exec executable="${Perl}">
<arg line="-I${JobOrderPerlLib}"/>
<arg line="${JobOrderPerl}/${JobScript}"/>
<arg line="${JobOrderOutput}"/>
</exec>
</target>


<target name="FtpToStaging">
<echo message="ftp : ${FTPServer} as ${FTPUserID}/${FTPPassword}"/>
<echo message="lcd : ${JobOrderOutput}"/>
<echo message="put : ${JobOrderOutputFileName}"/>
<ftp server="${FTPServer}"
remotedir="${FTPRemoteDir}"
userid="${FTPUserID}"
password="${FTPPassword}"<fileset dir="${JobOrderOutput}">
<include name="${JobOrderOutputFileName}"/>
</fileset>
</ftp>
</target>


<target name="StagingPushToRemote">
<telnet userid="${TNPStageUserID}"
password="${TNPStagePassword}"
server="${TNPStageServer}"<read string="${TNPStagePrompt}"/>
<write string="ftp ${TNPExternalHost}"/>
<read>):</read>
<write string="${TNPExternalHostUserID}"/>
<read>:</read>
<write string="${TNPExternalHostPassword}"/>
<read>ftp></read>
<write string="binary"/>
<read>ftp></read>
<write string="${TNPExecuteLCD}"/>
<read>ftp></read>
<write string="${TNPExecuteCD}"/>
<read>ftp></read>
<write string="${TNPExecutePush}"/>
<read>ftp></read>
<write>quit</write>
</telnet>
</target>

<target name="MainTarget" >
<antcall target="RunPerl"/>
<antcall target="FtpToStaging"/>
<antcall target="StagingPushToRemote"/>
</target>

</project>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top