Comments (2)
You didn't define neither prompt nor match pattern for your cmd
.
Take a look at the example in README.
from net-telnet.
I have a similar issue, but neither "Prompt" or "Match" work. This is because the Telnet server don't send any prompt. And the waitfor in the cmd function send only a Prompt in 0.2.0 version. I made a test in rewriting the cmd function that's give me satisfaction. Is my solution correct ? Could a correction be donne in next version ?
def cmd(options) # :yield: recvdata
match = @options["Prompt"]
time_out = @options["Timeout"]
fail_eof = @options["FailEOF"]
typeMatch = "Prompt"
if options.kind_of?(Hash)
cmd = options["Cmd"] if options.has_key?("String")
if options.has_key?("String")
match = options["String"]
typeMatch="String"
end
if options.has_key?("Match")
match = options["Match"]
typeMatch="Match"
end
time_out = options["Timeout"] if options.has_key?("Timeout")
fail_eof = options["FailEOF"] if options.has_key?("FailEOF")
else
cmd = options
end
self.puts(cmd)
if block_given?
waitfor({typeMatch => match, "Timeout" => time_out, "FailEOF" => fail_eof}){|c| yield c }
else
waitfor({typeMatch => match, "Timeout" => time_out, "FailEOF" => fail_eof})
end
end
from net-telnet.
Related Issues (14)
- How send telnet sub options? HOT 1
- Receiving response chunks from previous command execution on executing next command.
- 0.2.0 breaks major operating systems HOT 2
- Enhancement: Option to insert delay between each byte send
- How can I send response to a cmd to server? HOT 2
- Unable to break XML action.
- Send empty string with cmd ?
- Cmd function only accept Prompt for waitfor
- waitfor doesn't accept regex expression with string option !
- cmd returns strings with different encodings in some cases
- waitfor('Waittime'=>0) may wait forever
- Connect with no username/password HOT 1
- Connect to a host with no prompt? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from net-telnet.