...">

Ant telnet hangs on a simple task

<?xml version="1.0" ?>
<project name="test" default="root">
    <target name="telnet">
        <telnet server="10.1.1.1">
            <read>login:</read>
            <write>root</write>
            <read>password:</read>
            <write>${PASSWORD}</write>
            <read>#</read>
            <write>ls</write>
            <read>#</read>
        </telnet>
    </target>
</project>

This is the code that I have in the build.xml file. When I run ant (version 1.8, in bash) (I have already downloaded and copied to banks for commons-net-2.0 and jakarta-oro-2.0.8), this is the result I get:

Buildfile: /home/sagar/build.xml

telnet:

and then he just sits there. When I do “who” on my server, I see a “System” waiting to be logged in. But after that there is no progress. I can use telnet on the server using the usual telnet tools (putty, bash, etc.).

I even tried the full telnet command instead of reading / writing:

<telnet server="10.1.1.1" userid="root" password="root">

Any help is much appreciated!

Note: JRE 1.5, Ant 1.8, commons-net version 2.0, jakarta version 2.0.8

+3
source share
2 answers

Figured it out. For everyone who has this problem:

Ant 1.8.0, , commons-net-telnet. , , 1.7, .

6 , . ! > :

+4

Ant ( Nant Dark Side), , telnet, , initialCR, - ''.

, / , .. "-".

http://ant.apache.org/manual/Tasks/telnet.html

,

0

Source: https://habr.com/ru/post/1743213/


All Articles